diff --git a/devspaces-server/Dockerfile b/devspaces-server/build/dockerfiles/brew.Dockerfile similarity index 97% rename from devspaces-server/Dockerfile rename to devspaces-server/build/dockerfiles/brew.Dockerfile index b1340af648..c4c4079ac7 100644 --- a/devspaces-server/Dockerfile +++ b/devspaces-server/build/dockerfiles/brew.Dockerfile @@ -18,7 +18,7 @@ RUN microdnf install java-11-openjdk-headless tar gzip shadow-utils findutils && microdnf update -y && \ microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \ adduser -G root user && mkdir -p /home/user/devspaces -COPY entrypoint.sh /entrypoint.sh +COPY build/dockerfiles/entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] # see fetch-artifacts-pnc.yaml diff --git a/devspaces-server/entrypoint.sh b/devspaces-server/build/dockerfiles/entrypoint.sh similarity index 100% rename from devspaces-server/entrypoint.sh rename to devspaces-server/build/dockerfiles/entrypoint.sh diff --git a/devspaces-server/build/scripts/sync.sh b/devspaces-server/build/scripts/sync.sh index 3949dd0a6e..f2ba0187ed 100755 --- a/devspaces-server/build/scripts/sync.sh +++ b/devspaces-server/build/scripts/sync.sh @@ -51,6 +51,7 @@ echo ".github/ .gitattributes dockerfiles/ assets/branding/ +build/dockerfiles/ build/scripts/sync.sh /container.yaml /content_sets.* @@ -80,7 +81,11 @@ rsync -azrlt --checksum --exclude-from /tmp/rsync-excludes --delete ${SOURCEDIR} rm -f /tmp/rsync-excludes # copy entrypoint.sh -rsync -azrlt --checksum ${SOURCEDIR}/dockerfiles/che/entrypoint.sh ${TARGETDIR} +rsync -azrlt --checksum ${SOURCEDIR}/build/dockerfiles/entrypoint.sh ${TARGETDIR}/build/dockerfiles +#copy upstream Dockerfile as rhel.Dockerfile +rsync -azrlt --checksum ${SOURCEDIR}/build/dockerfiles/Dockerfile ${TARGETDIR}/build/dockerfiles/rhel.Dockerfile +#copy brew.dockerfile +rsync -azrlt --checksum ${SOURCEDIR}build/dockerfiles/brew.Dockerfile ${TARGETDIR}/build/dockerfiles # ensure shell scripts are executable find ${TARGETDIR}/ -name "*.sh" -exec chmod +x {} \; @@ -158,17 +163,7 @@ else fi generateFetchArtifactsPNCYaml -# NOTE: upstream Dockerfile is in non-standard path (not build/dockerfiles/Dockerfile) because project has multiple container builds -sed ${SOURCEDIR}/dockerfiles/che/Dockerfile -r \ - `# Strip registry from image references` \ - -e 's|FROM registry.access.redhat.com/|FROM |' \ - -e 's|FROM registry.redhat.io/|FROM |' \ - -e 's@/home/user/eclipse-che@/home/user/devspaces@g' \ - `# insert logic to unpack asset-*.tgz` \ - -e 's@ADD eclipse-che .+@# see fetch-artifacts-pnc.yaml\nCOPY artifacts/assembly-main.tar.gz /tmp/assembly-main.tar.gz\nRUN tar xzf /tmp/assembly-main.tar.gz --strip-components=1 -C /home/user/devspaces; rm -f /tmp/assembly-main.tar.gz\n@g' \ - -e 's@chmod g\\+w /home/user/cacerts@chmod 777 /home/user/cacerts@g' \ -> ${TARGETDIR}/Dockerfile -cat << EOT >> ${TARGETDIR}/Dockerfile +cat << EOT >> ${TARGETDIR}/build/dockerfiles/brew.Dockerfile ENV SUMMARY="Red Hat OpenShift Dev Spaces server container" \\ DESCRIPTION="Red Hat OpenShift Dev Spaces server container" \\ PRODNAME="devspaces" \\ @@ -188,7 +183,7 @@ LABEL summary="\$SUMMARY" \\ io.openshift.expose-services="" \\ usage="" EOT -echo "Converted Dockerfile" +echo "Converted brew.Dockerfile" # add ignore for the tarball in mid and downstream echo "/assembly-main.tar.gz" >> ${TARGETDIR}/.gitignore