blob: 6a0606dce0d98b4f2b458d77e23c4f5e7faee72a [file] [log] [blame]
Jess Frazelle0f330142018-01-01 15:42:02 -05001FROM golang:alpine as builder
Jess Frazelle5236e582017-08-03 23:10:03 -04002MAINTAINER Jessica Frazelle <jess@linux.com>
3
4ENV PATH /go/bin:/usr/local/go/bin:$PATH
5ENV GOPATH /go
6
7RUN apk add --no-cache \
Jess Frazelle84320152018-12-28 22:19:28 -05008 bash \
Jess Frazelle5236e582017-08-03 23:10:03 -04009 ca-certificates
10
C.J. Jameson3ac682f2018-03-11 09:06:23 -070011COPY . /go/src/github.com/genuinetools/amicontained
Jess Frazelle5236e582017-08-03 23:10:03 -040012
13RUN set -x \
14 && apk add --no-cache --virtual .build-deps \
Jess Frazelle5236e582017-08-03 23:10:03 -040015 git \
16 gcc \
17 libc-dev \
18 libgcc \
Jess Frazelle0f330142018-01-01 15:42:02 -050019 make \
C.J. Jameson3ac682f2018-03-11 09:06:23 -070020 && cd /go/src/github.com/genuinetools/amicontained \
Jess Frazelle0f330142018-01-01 15:42:02 -050021 && make static \
22 && mv amicontained /usr/bin/amicontained \
Jess Frazelle5236e582017-08-03 23:10:03 -040023 && apk del .build-deps \
24 && rm -rf /go \
25 && echo "Build complete."
26
Jess Frazellec4d0b9b2018-09-25 09:26:41 -040027FROM alpine:latest
Jess Frazelle0f330142018-01-01 15:42:02 -050028
29COPY --from=builder /usr/bin/amicontained /usr/bin/amicontained
30COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
Jess Frazelle5236e582017-08-03 23:10:03 -040031
32ENTRYPOINT [ "amicontained" ]
Jess Frazellea0ef3852019-11-19 21:14:09 -080033CMD [ "--help" ]