-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1054 from vvoland/rhel-poc-27.x
[27.x] RHEL PoC
- Loading branch information
Showing
5 changed files
with
99 additions
and
3 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
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
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_IMAGE | ||
ARG DISTRO=rhel | ||
ARG SUITE=8 | ||
ARG BUILD_IMAGE=registry.access.redhat.com/ubi8/ubi | ||
|
||
FROM ${GO_IMAGE} AS golang | ||
|
||
FROM ${BUILD_IMAGE} AS subscribed-image | ||
RUN --mount=type=secret,id=rh-user --mount=type=secret,id=rh-pass <<-EOT | ||
rm -f /etc/rhsm-host | ||
|
||
if [ ! -f /run/secrets/rh-user ] || [ ! -f /run/secrets/rh-pass ]; then | ||
echo "Either RH_USER or RH_PASS is not set. Running build without subscription." | ||
else | ||
subscription-manager register \ | ||
--username="$(cat /run/secrets/rh-user)" \ | ||
--password="$(cat /run/secrets/rh-pass)" | ||
|
||
subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms | ||
# dnf config-manager --set-enabled codeready-builder-for-rhel-8-$(arch)-rpms | ||
fi | ||
EOT | ||
|
||
FROM subscribed-image | ||
|
||
ENV GOPROXY=https://proxy.golang.org|direct | ||
ENV GO111MODULE=off | ||
ENV GOPATH=/go | ||
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin | ||
ENV AUTO_GOPATH 1 | ||
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs | ||
ARG DISTRO | ||
ARG SUITE | ||
ENV DISTRO=${DISTRO} | ||
ENV SUITE=${SUITE} | ||
|
||
RUN dnf install -y rpm-build rpmlint | ||
COPY --link SPECS /root/rpmbuild/SPECS | ||
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec | ||
COPY --link --from=golang /usr/local/go /usr/local/go | ||
WORKDIR /root/rpmbuild | ||
ENTRYPOINT ["/bin/rpmbuild"] |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_IMAGE | ||
ARG DISTRO=rhel | ||
ARG SUITE=9 | ||
ARG BUILD_IMAGE=registry.access.redhat.com/ubi9/ubi | ||
|
||
FROM ${GO_IMAGE} AS golang | ||
|
||
FROM ${BUILD_IMAGE} AS subscribed-image | ||
RUN --mount=type=secret,id=rh-user --mount=type=secret,id=rh-pass <<-EOT | ||
rm -f /etc/rhsm-host | ||
|
||
if [ ! -f /run/secrets/rh-user ] || [ ! -f /run/secrets/rh-pass ]; then | ||
echo "Either RH_USER or RH_PASS is not set. Running build without subscription." | ||
else | ||
subscription-manager register \ | ||
--username="$(cat /run/secrets/rh-user)" \ | ||
--password="$(cat /run/secrets/rh-pass)" | ||
|
||
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms | ||
# dnf config-manager --set-enabled codeready-builder-for-rhel-9-$(arch)-rpms | ||
fi | ||
EOT | ||
|
||
FROM subscribed-image | ||
|
||
ENV GOPROXY=https://proxy.golang.org|direct | ||
ENV GO111MODULE=off | ||
ENV GOPATH=/go | ||
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin | ||
ENV AUTO_GOPATH 1 | ||
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs | ||
ARG DISTRO | ||
ARG SUITE | ||
ENV DISTRO=${DISTRO} | ||
ENV SUITE=${SUITE} | ||
|
||
RUN dnf install -y rpm-build rpmlint | ||
COPY --link SPECS /root/rpmbuild/SPECS | ||
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec | ||
COPY --link --from=golang /usr/local/go /usr/local/go | ||
WORKDIR /root/rpmbuild | ||
ENTRYPOINT ["/bin/rpmbuild"] |