bazel: remove apko and Dockerfile where Bazel is used to build container images

This commit is contained in:
Malte Poll 2023-04-04 15:24:43 +02:00 committed by Malte Poll
parent 19ff132ee8
commit 5145f806ea
33 changed files with 15 additions and 1517 deletions

View file

@ -1,34 +0,0 @@
FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2 as build
RUN dnf -y update && \
dnf -y install libvirt-devel @development-tools pkg-config wget git && \
dnf clean all
ARG GO_VER=1.20.3
RUN wget -q https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GO_VER}.linux-amd64.tar.gz && \
rm go${GO_VER}.linux-amd64.tar.gz
ENV PATH ${PATH}:/usr/local/go/bin
WORKDIR /qemu-metadata-api
# Necessary to make `go mod download all` work while having a local replace rule in the root-go.mod.
COPY operators/constellation-node-operator/api/go.mod ./operators/constellation-node-operator/api/go.mod
COPY operators/constellation-node-operator/api/go.sum ./operators/constellation-node-operator/api/go.sum
COPY go.mod ./
COPY go.sum ./
RUN go mod download all
WORKDIR /qemu-metadata-api/hack
COPY hack/go.mod ./go.mod
COPY hack/go.sum ./go.sum
RUN go mod download all
COPY . /qemu-metadata-api
WORKDIR /qemu-metadata-api/hack/qemu-metadata-api
RUN go build -o api-server .
FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2 as release
RUN dnf -y install libvirt-devel && \
dnf clean all
COPY --from=build /qemu-metadata-api/hack/qemu-metadata-api/api-server /server
ENTRYPOINT [ "/server" ]

View file

@ -36,7 +36,10 @@ sudo firewall-cmd --zone libvirt --add-port 8080/tcp --permanent
Build the image:
```shell
DOCKER_BUILDKIT=1 docker build -t ghcr.io/edgelesssys/constellation/qemu-metadata-api:latest -f hack/qemu-metadata-api/Dockerfile .
bazel build //hack/qemu-metadata-api:qemumetadata
bazel build //bazel/release:qemumetadata_sum
bazel build //bazel/release:qemumetadata_tar
bazel run //bazel/release:qemumetadata_push
```
A container of the image is automatically started by Terraform.