This repository has been archived on 2024-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
stagex/tests/go/Dockerfile

15 lines
365 B
Docker

FROM ocirep/busybox as build
COPY --from=ocirep/go . /
COPY . .
RUN \
go build main.go \
&& mkdir -p $HOME/rootfs/etc \
&& echo "nogroup:*:100:nobody" > ~/rootfs/etc/group \
&& echo "nobody:*:100:100:::" > ~/rootfs/etc/passwd \
&& cp main $HOME/rootfs/
FROM scratch
COPY --from=build --chown=100:100 /home/user/rootfs /
USER 100:100
ENTRYPOINT ["/main"]