Files
linuxkit/pkg/mount/Dockerfile
2025-01-08 20:54:08 +02:00

31 lines
833 B
Docker

FROM linuxkit/alpine:5ac048802293564a50414394e1b9896eac528e7d 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 \
musl \
sfdisk \
&& true
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
FROM linuxkit/alpine:5ac048802293564a50414394e1b9896eac528e7d AS build
RUN apk add --no-cache go musl-dev
ARG GOPKGVERSION
ENV ldflags="-X main.Version=$GOPKGVERSION"
ENV GOPATH=/go PATH=$PATH:/go/bin
# 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/mountie
RUN go-compile.sh /go/src/mountie
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=mirror /out/ /
COPY --from=build /go/bin/mount usr/bin/mountie
CMD ["/usr/bin/mountie"]