forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add creation of the conda-ci-linux-64 container (conda#10795)
* Add creation of the conda-ci-linux-64 container The logic moved from https://github.com/ContinuumIO/docker-images While the Dockerfile is untouched, the github action was updated to use a build matrix, to publish to ghcr.io and to specify the Python version in the image tag instead of the image name. * Adapt to review findings * Add Dockerfile linting with hadolint
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build and Publish Conda CI Images | ||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
pull_request: | ||
paths: | ||
- 'ci/Dockerfile' | ||
- '.github/workflows/ci_image.yml' | ||
push: | ||
paths: | ||
- 'ci/Dockerfile' | ||
- '.github/workflows/ci_image.yml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.7, 3.8, 3.9] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: lint | ||
uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ./ci/Dockerfile | ||
|
||
- name: build-push conda-ci-linux-64-python-${{ matrix.python }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./ci | ||
file: ./ci/Dockerfile | ||
build-args: PYTHON_VERSION=${{ matrix.python }} | ||
tags: conda/conda-ci-linux-64:python${{ matrix.python }}-latest | ||
push: ${{ github.ref == 'refs/heads/master' }} | ||
|
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,43 @@ | ||
FROM debian:buster-slim | ||
|
||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | ||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
# hadolint ignore=DL3008 | ||
RUN apt-get update --fix-missing && \ | ||
apt-get install -y --no-install-recommends tini wget build-essential bzip2 ca-certificates libglib2.0-0 libxext6 libsm6 libxrender1 git mercurial subversion sudo && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
useradd -m -s /bin/bash test_user && \ | ||
usermod -u 1001 test_user && \ | ||
groupmod -g 1001 test_user && \ | ||
echo "test_user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \ | ||
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ | ||
/bin/bash ~/miniconda.sh -b -p /opt/conda && \ | ||
rm ~/miniconda.sh && \ | ||
/opt/conda/bin/conda clean --all --yes | ||
|
||
ARG PYTHON_VERSION=3.8 | ||
|
||
# conda and test dependencies | ||
RUN /opt/conda/bin/conda install --update-all -y -c defaults \ | ||
conda conda-package-handling \ | ||
python=$PYTHON_VERSION pip pycosat requests ruamel_yaml cytoolz \ | ||
anaconda-client nbformat make \ | ||
pytest pytest-cov codecov radon pytest-timeout mock responses pexpect \ | ||
flake8 && \ | ||
/opt/conda/bin/conda clean --all --yes | ||
|
||
# conda-build and test dependencies | ||
RUN /opt/conda/bin/conda install --update-all -y -c defaults \ | ||
conda-build patch git \ | ||
perl pytest-xdist pytest-mock \ | ||
anaconda-client \ | ||
filelock jinja2 conda-verify pkginfo \ | ||
glob2 beautifulsoup4 chardet pycrypto \ | ||
&& /opt/conda/bin/conda clean --all --yes | ||
|
||
USER test_user | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
CMD ["/bin/bash"] |