mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-15 14:50:41 +00:00
tools: Use the Alpine base to build the go-compile image
Also, convert to use a git tree hash. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
FROM alpine:3.5
|
||||
RUN apk update && apk add --no-cache build-base git go
|
||||
FROM linuxkit/alpine:451603daf499e3a40308dbf5571dcffed2343ffa AS mirror
|
||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
||||
RUN apk add --no-cache --initdb -p /out \
|
||||
alpine-baselayout \
|
||||
busybox \
|
||||
git \
|
||||
go \
|
||||
musl-dev
|
||||
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
||||
|
||||
FROM scratch
|
||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||
RUN go get -u github.com/golang/lint/golint && \
|
||||
go get -u github.com/gordonklaus/ineffassign && \
|
||||
go get -u github.com/LK4D4/vndr
|
||||
|
||||
COPY . ./
|
||||
|
||||
COPY --from=mirror /out/ /
|
||||
COPY --from=mirror /go/bin/ /go/bin/
|
||||
COPY /compile.sh /compile.sh
|
||||
ENTRYPOINT ["/compile.sh"]
|
||||
|
Reference in New Issue
Block a user