Skip to content

Commit

Permalink
Use centos stream to build and create repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrero committed Jul 5, 2022
1 parent d98d30b commit 574e822
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions extensions/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
## Builds the webserver for the repo service.
FROM golang as gobuild
ADD repo-server/main.go .
RUN mkdir /build
RUN go build -o /build/webserver main.go

## Downloads the extensions given the extensions.yaml
ARG RHCOS_VERSION=latest
FROM registry.ci.openshift.org/rhcos-devel/rhel-coreos:${RHCOS_VERSION} as os
#Expects repos from redhat-coreos, like when building rhcos locally.
RUN rpm-ostree compose extensions --rootfs=/ --output-dir=/usr/share/rpm-ostree/extensions/ {manifest,extensions}.yaml

## Creates the repo metadata for the extensions
FROM quay.io/centos/centos:stream8 as repo
FROM quay.io/centos/centos:stream8 as builder
COPY --from=os /usr/share/rpm-ostree/extensions/ /usr/share/rpm-ostree/extensions/
RUN dnf install -y createrepo_c
RUN dnf install -y createrepo_c golang
ADD repo-server/main.go .
RUN mkdir /build
RUN go build -o /build/webserver main.go

RUN createrepo_c /usr/share/rpm-ostree/extensions/

## Final container that has the extensions and webserver
FROM registry.access.redhat.com/ubi8/ubi:latest
COPY --from=gobuild /build/webserver /usr/bin/webserver
COPY --from=repo /usr/share/rpm-ostree/extensions/ /usr/share/rpm-ostree/extensions/
COPY --from=builder /build/webserver /usr/bin/webserver
COPY --from=builder /usr/share/rpm-ostree/extensions/ /usr/share/rpm-ostree/extensions/

CMD ["./usr/bin/webserver"]
EXPOSE 9666/tcp

0 comments on commit 574e822

Please sign in to comment.