Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: CRW-4043 #416

Open
wants to merge 2 commits into
base: devspaces-3-rhel-8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions devspaces-traefik/build/dockerfiles/rhel.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.8-860 as builder
USER 0

# CRW-3531 note: build fails when run with python39 and nodejs:16; so stick with python2 and nodejs:12
ENV NODEJS_VERSION="12"
RUN microdnf -y install dnf && \
dnf -y -q install python2 golang make gcc-c++ openssl-devel && \
dnf -y -q module install nodejs:$NODEJS_VERSION && \
npm -g i yarn && \
yarn config set nodedir /usr

#WEBUI
RUN mkdir /src
COPY ./ /src/

WORKDIR /src/webui
RUN yarn config set unsafe-perm true && \
yarn install && \
npm run build:nc

#GO BUILD
ARG TRAEFIK_SHA="c9520"
ENV TRAEFIK_SHA="${TRAEFIK_SHA}"

RUN cp /src/script/ca-certificates.crt /etc/ssl/certs/

WORKDIR /src

RUN go mod download && \
go generate && \
go build ./cmd/traefik

# https://registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.8-860

COPY --from=builder /src/script/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/traefik /traefik

RUN chmod 755 /traefik && \
microdnf -y update || true && \
microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages"

EXPOSE 80
VOLUME ["/tmp"]
ENTRYPOINT ["/traefik"]
48 changes: 0 additions & 48 deletions devspaces-traefik/build/rhel.Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions devspaces-traefik/build/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ sed -r \
-e "s#ARG TRAEFIK_SHA=\".*\"#ARG TRAEFIK_SHA=\"${SOURCE_SHA}\"#g" \
`# Remove registry so build works in Brew` \
-e "s#FROM (registry.access.redhat.com|registry.redhat.io)/#FROM #g" \
"${TARGETDIR}"/build/rhel.Dockerfile > "${TARGETDIR}"/Dockerfile
"${TARGETDIR}"/build/dockerfiles/rhel.Dockerfile > "${TARGETDIR}"/build/dockerfiles/brew.Dockerfile

cat << EOT >> "${TARGETDIR}"/Dockerfile
cat << EOT >> "${TARGETDIR}"/brew.Dockerfile

ENV SUMMARY="Red Hat OpenShift Dev Spaces ${MIDSTM_NAME} container" \\
DESCRIPTION="Red Hat OpenShift Dev Spaces ${MIDSTM_NAME} container" \\
Expand All @@ -120,4 +120,4 @@ LABEL summary="\$SUMMARY" \\
io.openshift.expose-services="" \\
usage=""
EOT
echo "Converted Dockerfile"
echo "Converted brew.Dockerfile"