mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-25 23:13:03 +00:00
22 lines
645 B
Docker
22 lines
645 B
Docker
FROM linuxkit/alpine:7f3944798557de5518a56e3437d7ed982701f224 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"]
|