-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use centos stream to build and create repo
- Loading branch information
Showing
1 changed file
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |