2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-03-09 02:19:17 +00:00
|
|
|
ENV VERSION=0.0.5
|
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-03-09 02:19:17 +00:00
|
|
|
ENV SRC_HASH=26f0dd95e72b632036c598d055ef6b78cec88c497dd67ede30d1498bb8229412
|
2024-02-13 03:33:08 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-13 03:33:08 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/go . /
|
2024-02-13 03:33:08 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR sxctl/cmd/sxctl
|
2024-02-15 03:58:54 +00:00
|
|
|
RUN go build -o sxctl
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-15 03:58:54 +00:00
|
|
|
WORKDIR /rootfs
|
|
|
|
RUN cp /sxctl/cmd/sxctl/sxctl .
|
2024-02-13 03:33:08 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|
2024-02-15 03:58:54 +00:00
|
|
|
ENTRYPOINT ["/sxctl"]
|