mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-25 10:12:31 +00:00
22 lines
645 B
Docker
22 lines
645 B
Docker
FROM linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e AS mirror
|
|
|
|
RUN apk add --no-cache go musl-dev linux-headers
|
|
ARG GOPKGVERSION
|
|
ENV ldflags="-X main.Version=$GOPKGVERSION"
|
|
ENV GOPATH=/go PATH=$PATH:/go/bin GO111MODULE=off
|
|
# Hack to work around an issue with go on arm64 requiring gcc
|
|
RUN [ $(uname -m) = aarch64 ] && apk add --no-cache gcc || true
|
|
|
|
COPY . /go/src/metadata/
|
|
RUN go-compile.sh /go/src/metadata
|
|
|
|
RUN mkdir -p out/tmp out/var out/run out/dev out/etc out/etc/ssl/certs
|
|
|
|
FROM scratch
|
|
ENTRYPOINT []
|
|
CMD []
|
|
WORKDIR /
|
|
COPY --from=mirror /go/bin/metadata /usr/bin/metadata
|
|
COPY --from=mirror /out/ /
|
|
CMD ["/usr/bin/metadata"]
|