2018-11-13 03:44:15 +00:00
|
|
|
# ------------------------------------------------------------------------
|
2024-04-15 13:32:43 +00:00
|
|
|
from golang:1.22.2-bookworm as build
|
2024-01-07 09:56:42 +00:00
|
|
|
|
2023-11-07 14:13:29 +00:00
|
|
|
run apt-get update && apt-get install -y git
|
2024-01-07 09:56:42 +00:00
|
|
|
|
2023-11-07 14:13:29 +00:00
|
|
|
workdir /src
|
2024-01-07 09:56:42 +00:00
|
|
|
|
2023-11-07 14:13:29 +00:00
|
|
|
copy go.mod go.sum ./
|
2024-01-07 09:56:42 +00:00
|
|
|
run \
|
|
|
|
--mount=type=cache,id=gomod,target=/go/pkg/mod \
|
|
|
|
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
|
|
|
|
go mod download
|
|
|
|
|
2024-01-07 10:09:20 +00:00
|
|
|
arg GIT_TAG
|
|
|
|
|
2023-11-07 14:13:29 +00:00
|
|
|
copy . ./
|
2024-01-07 09:56:42 +00:00
|
|
|
run \
|
|
|
|
--mount=type=cache,id=gomod,target=/go/pkg/mod \
|
|
|
|
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
|
|
|
|
go test ./... && \
|
|
|
|
hack/build ./...
|
2018-06-19 06:49:34 +00:00
|
|
|
|
2018-11-13 03:44:15 +00:00
|
|
|
# ------------------------------------------------------------------------
|
2024-04-16 09:38:04 +00:00
|
|
|
from debian:bookworm
|
2018-11-13 03:44:15 +00:00
|
|
|
entrypoint ["/bin/dkl-local-server"]
|
2018-06-19 06:49:34 +00:00
|
|
|
|
2019-10-19 04:08:41 +00:00
|
|
|
env _uncache 1
|
2018-06-19 06:49:34 +00:00
|
|
|
run apt-get update \
|
2023-11-07 14:13:29 +00:00
|
|
|
&& yes |apt-get install -y genisoimage gdisk dosfstools util-linux udev binutils systemd \
|
|
|
|
grub2 grub-pc-bin grub-efi-amd64-bin ca-certificates curl openssh-client \
|
2018-11-13 03:44:15 +00:00
|
|
|
&& apt-get clean
|
|
|
|
|
2023-11-07 14:13:29 +00:00
|
|
|
copy --from=build /src/dist/ /bin/
|