blob: 7eb37e6738c1da3092639d6c884249b91c36fdf5 [file] [log] [blame]
Jess Frazelle2b0bc862016-09-22 09:49:45 -07001FROM alpine:edge
2MAINTAINER Jessica Frazelle <jess@linux.com>
3
4ENV PATH /go/bin:/usr/local/go/bin:$PATH
5ENV GOPATH /go
6
7RUN apk add --no-cache \
8 autoconf \
9 automake \
10 bash \
11 build-base \
12 ca-certificates \
Jess Frazelleeb578b82019-05-25 18:09:35 -040013 check-dev \
Jess Frazelle331ef482016-09-22 15:01:36 -070014 file \
15 flex \
Jess Frazelle2b0bc862016-09-22 09:49:45 -070016 gengetopt \
17 git \
18 gcc \
19 go \
20 help2man \
21 libc-dev \
22 libgcc \
23 libtool \
Jess Frazelle12739d52016-09-22 17:06:37 -070024 libusb-dev \
Jess Frazelle2b0bc862016-09-22 09:49:45 -070025 openssl-dev \
26 pcsc-lite-dev
27
28RUN go get github.com/xlab/cgogen \
Jess Frazelle360f0482019-05-25 17:25:01 -040029 && go get golang.org/x/lint/golint
Jess Frazelle2b0bc862016-09-22 09:49:45 -070030
Jess Frazelle12739d52016-09-22 17:06:37 -070031#Install pcsclite
Jess Frazelleba4f13f2018-07-14 13:33:47 -040032RUN git clone https://github.com/LudovicRousseau/PCSC.git /usr/src/pcsc \
Jess Frazelle331ef482016-09-22 15:01:36 -070033 && ( \
34 cd /usr/src/pcsc \
Jess Frazelle12739d52016-09-22 17:06:37 -070035 && ./bootstrap \
Jess Frazelled5914782017-12-14 13:47:22 -050036 && ./configure --prefix=/usr --disable-libsystemd \
Jess Frazelle12739d52016-09-22 17:06:37 -070037 && make \
38 && make install \
39 )
Jess Frazelleba4f13f2018-07-14 13:33:47 -040040
Jess Frazelle12739d52016-09-22 17:06:37 -070041# Install ccid
Jess Frazelleba4f13f2018-07-14 13:33:47 -040042RUN git clone https://github.com/LudovicRousseau/CCID.git /usr/src/ccid \
Jess Frazelle12739d52016-09-22 17:06:37 -070043 && ( \
44 cd /usr/src/ccid \
45 && git submodule init \
46 && git submodule update \
Jess Frazelle331ef482016-09-22 15:01:36 -070047 && ./bootstrap \
48 && ./configure --prefix=/usr \
49 && make \
50 && make install \
51 )
Jess Frazelle2b0bc862016-09-22 09:49:45 -070052
Jess Frazelleeb578b82019-05-25 18:09:35 -040053ENV YKPIV_VERSION 1.7.0
Jess Frazelle2b0bc862016-09-22 09:49:45 -070054RUN git clone --depth 1 -b "yubico-piv-tool-${YKPIV_VERSION}" \
55 https://github.com/Yubico/yubico-piv-tool.git /usr/src/yubico-piv-tool \
56 && ( \
57 cd /usr/src/yubico-piv-tool \
58 && autoreconf --install \
59 && ./configure --prefix=/usr \
60 && make \
61 && make install \
62 )
63
Jess Frazelle331ef482016-09-22 15:01:36 -070064ENV PKG_CONFIG_PATH /usr/lib/pkgconfig:/usr/src/yubico-piv-tool/ykpiv
Jess Frazelle79476342016-09-30 11:29:57 -070065COPY . /go/src/github.com/jessfraz/ykpiv
66WORKDIR /go/src/github.com/jessfraz/ykpiv