local-server/Dockerfile

34 lines
908 B
Docker
Raw Permalink Normal View History

2018-11-13 14:44:15 +11:00
# ------------------------------------------------------------------------
2024-04-15 15:32:43 +02:00
from golang:1.22.2-bookworm as build
2024-01-07 10:56:42 +01:00
2023-11-07 15:13:29 +01:00
run apt-get update && apt-get install -y git
2024-01-07 10:56:42 +01:00
2023-11-07 15:13:29 +01:00
workdir /src
2024-01-07 10:56:42 +01:00
2023-11-07 15:13:29 +01:00
copy go.mod go.sum ./
2024-01-07 10:56:42 +01: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 11:09:20 +01:00
arg GIT_TAG
2023-11-07 15:13:29 +01:00
copy . ./
2024-01-07 10:56:42 +01: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 17:49:34 +11:00
2018-11-13 14:44:15 +11:00
# ------------------------------------------------------------------------
2024-04-16 11:38:04 +02:00
from debian:bookworm
2018-11-13 14:44:15 +11:00
entrypoint ["/bin/dkl-local-server"]
2018-06-19 17:49:34 +11:00
2024-11-04 22:44:46 +01:00
env _uncache=1
2018-06-19 17:49:34 +11:00
run apt-get update \
2023-11-07 15:13:29 +01: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 14:44:15 +11:00
&& apt-get clean
2023-11-07 15:13:29 +01:00
copy --from=build /src/dist/ /bin/