2023-03-17 13:47:36 -04:00
|
|
|
FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2 as build
|
2022-06-30 05:14:26 -04:00
|
|
|
|
|
|
|
RUN dnf -y update && \
|
|
|
|
dnf -y install libvirt-devel @development-tools pkg-config wget git && \
|
|
|
|
dnf clean all
|
|
|
|
|
2023-03-08 04:05:36 -05:00
|
|
|
ARG GO_VER=1.20.2
|
2022-09-02 06:45:56 -04:00
|
|
|
RUN wget -q https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
|
2022-06-30 05:14:26 -04:00
|
|
|
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
|
2023-02-16 04:23:03 -05:00
|
|
|
# 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
|
2022-06-30 05:14:26 -04:00
|
|
|
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
|
2023-02-20 12:23:09 -05:00
|
|
|
RUN go build -o api-server .
|
2022-06-30 05:14:26 -04:00
|
|
|
|
2023-03-17 13:47:36 -04:00
|
|
|
FROM fedora:37@sha256:3f987b7657e944cf87a129cc262982d4f80e38bd98f7db313ccaf90ca7069dd2 as release
|
2022-06-30 05:14:26 -04:00
|
|
|
RUN dnf -y install libvirt-devel && \
|
|
|
|
dnf clean all
|
|
|
|
COPY --from=build /qemu-metadata-api/hack/qemu-metadata-api/api-server /server
|
|
|
|
ENTRYPOINT [ "/server" ]
|