Skip to content

Commit

Permalink
Merge pull request #273 from jakirkham/reuse_cos7_img
Browse files Browse the repository at this point in the history
Reuse one `Dockerfile` for all CentOS 7 builds
  • Loading branch information
xhochy authored Oct 1, 2024
2 parents cba7533 + 12ee4c6 commit 7b95859
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .circleci/test_docker_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ touch /opt/conda/bin/test_conda_forge
# check that conda is activated
conda info

# show all packages installed in root
# show all packages installed in base
conda list

# check that we can install a conda package
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@ jobs:
matrix:
cfg:
- DOCKERIMAGE: linux-anvil-cos7-x86_64
DOCKERFILE: linux-anvil-cos7
DOCKERTAG: latest
DISTRO_ARCH: "amd64"
DISTRO_NAME: "centos"
DISTRO_VER: "7"
SHORT_DESCRIPTION: "conda-forge build image for Cent0S 7 on x86_64"

- DOCKERIMAGE: linux-anvil-ppc64le
DOCKERFILE: linux-anvil-cos7
DOCKERTAG: latest
DISTRO_ARCH: "ppc64le"
DISTRO_NAME: "centos"
DISTRO_VER: "7"
SHORT_DESCRIPTION: "conda-forge build image for Cent0S 7 on ppc64le"

- DOCKERIMAGE: linux-anvil-aarch64
DOCKERFILE: linux-anvil-cos7
DOCKERTAG: latest
DISTRO_ARCH: "arm64"
DISTRO_NAME: "centos"
DISTRO_VER: "7"
SHORT_DESCRIPTION: "conda-forge build image for Cent0S 7 on aarch64"
Expand Down
54 changes: 0 additions & 54 deletions linux-anvil-aarch64/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions linux-anvil-cos7-x86_64/entrypoint_source

This file was deleted.

24 changes: 18 additions & 6 deletions linux-anvil-cos7-x86_64/Dockerfile → linux-anvil-cos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
# Set `ARG`s for use in `FROM`.
ARG DISTRO_ARCH
ARG DISTRO_NAME
ARG DISTRO_VER
FROM ${DISTRO_NAME}:${DISTRO_VER}
FROM --platform=linux/${DISTRO_ARCH} ${DISTRO_NAME}:${DISTRO_VER}

LABEL maintainer="conda-forge <conda-forge@googlegroups.com>"

# Set `ARG`s during build.
ARG DISTRO_ARCH
ARG DISTRO_NAME
ARG DISTRO_VER
ENV DISTRO_NAME=${DISTRO_NAME} \
ENV DISTRO_ARCH=${DISTRO_ARCH} \
DISTRO_NAME=${DISTRO_NAME} \
DISTRO_VER=${DISTRO_VER}

# Set an encoding to make things work smoothly.
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# bust the docker cache so that we always rerun the installs below
ADD https://loripsum.net/api /opt/docker/etc/gibberish

# Add qemu in here so that we can use this image on regular linux hosts with qemu user installed
ADD qemu-aarch64-static /usr/bin/qemu-aarch64-static
ADD qemu-ppc64le-static /usr/bin/qemu-ppc64le-static
ADD qemu-s390x-static /usr/bin/qemu-s390x-static

# bust the docker cache so that we always rerun the installs below
ADD https://loripsum.net/api /opt/docker/etc/gibberish
# (arm64v8/centos:7 only) Fix language override to get a working en_US.UTF-8 locale; backports:
# https://github.com/CentOS/sig-cloud-instance-build/commit/2892c17fa8a520e58c3f42cd56587863fe675670
RUN if [ "${DISTRO_ARCH}" = "arm64" ] && [ "${DISTRO_NAME}${DISTRO_VER}" = "centos7" ]; then \
sed -i 's/override_install_langs=en_US\.UTF-8/override_install_langs=en_US.utf8/' /etc/yum.conf ; \
fi

# Add the archived repo URL and fix RPM imports
ADD centos7-repos /tmp/centos7-repos
Expand All @@ -42,11 +54,11 @@ RUN /opt/docker/bin/run_commands
# Add a file for users to source to activate the `conda`
# environment `base`. Also add a file that wraps that for
# use with the `ENTRYPOINT`.
COPY linux-anvil-cos7-x86_64/entrypoint_source /opt/docker/bin/entrypoint_source
COPY linux-anvil-cos7/entrypoint_source /opt/docker/bin/entrypoint_source
COPY scripts/entrypoint /opt/docker/bin/entrypoint

# Ensure that all containers start with tini and the user selected process.
# Activate the `conda` environment `base` and the devtoolset compiler.
# Activate the `conda` environment `base`.
# Provide a default command (`bash`), which will start if the user doesn't specify one.
ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/opt/docker/bin/entrypoint" ]
CMD [ "/bin/bash" ]
File renamed without changes.
52 changes: 0 additions & 52 deletions linux-anvil-ppc64le/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions linux-anvil-ppc64le/entrypoint_source

This file was deleted.

0 comments on commit 7b95859

Please sign in to comment.