2022-11-04 06:49:41 -04:00
|
|
|
FROM fedora:36@sha256:455fec9590de794fbc21f61dbc7e90bf9918b58492d2a03fa269c09db47b43f6 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
|
|
|
|
|
2022-11-02 06:17:29 -04:00
|
|
|
ARG GO_VER=1.19.3
|
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
|
|
|
|
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 ./main.go
|
|
|
|
|
2022-11-04 06:49:41 -04:00
|
|
|
FROM fedora:36@sha256:455fec9590de794fbc21f61dbc7e90bf9918b58492d2a03fa269c09db47b43f6 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" ]
|