local-server/Dockerfile
Mikaël Cluseau d4dbe709e0 bump go
2024-03-02 20:52:24 +01:00

34 lines
908 B
Docker

# ------------------------------------------------------------------------
from golang:1.22.0-bullseye as build
run apt-get update && apt-get install -y git
workdir /src
copy go.mod go.sum ./
run \
--mount=type=cache,id=gomod,target=/go/pkg/mod \
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
go mod download
arg GIT_TAG
copy . ./
run \
--mount=type=cache,id=gomod,target=/go/pkg/mod \
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
go test ./... && \
hack/build ./...
# ------------------------------------------------------------------------
from debian:bullseye
entrypoint ["/bin/dkl-local-server"]
env _uncache 1
run apt-get update \
&& 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 \
&& apt-get clean
copy --from=build /src/dist/ /bin/