2024-02-13 03:33:08 +00:00
|
|
|
FROM scratch as base
|
2024-02-13 19:14:59 +00:00
|
|
|
ENV VERSION=0.0.3
|
2024-02-13 03:33:08 +00:00
|
|
|
ENV SRC_FILE=v${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://codeberg.org/stagex/sxctl/archive/${SRC_FILE}
|
2024-02-13 19:14:59 +00:00
|
|
|
ENV SRC_HASH=1d159266f669f206d6dbccdb4702d5b72d5f985fd29a83410929fc75b8575d8f
|
2024-02-13 03:33:08 +00:00
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
|
|
|
FROM fetch as build
|
|
|
|
COPY --from=busybox . /
|
|
|
|
COPY --from=go . /
|
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR sxctl/cmd/sxctl
|
2024-02-15 03:58:54 +00:00
|
|
|
RUN go build -o sxctl
|
|
|
|
|
|
|
|
FROM build as install
|
|
|
|
WORKDIR /rootfs
|
|
|
|
RUN cp /sxctl/cmd/sxctl/sxctl .
|
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2024-02-13 03:33:08 +00:00
|
|
|
|
|
|
|
FROM scratch as package
|
2024-02-15 03:58:54 +00:00
|
|
|
COPY --from=install /rootfs /
|
|
|
|
ENTRYPOINT ["/sxctl"]
|