├── .circleci ├── config.yml ├── schedule.json └── update-schedule.sh ├── .github ├── CODEOWNERS ├── CONTRIBUTING ├── ISSUE_TEMPLATE │ ├── cimg-bug-report.md │ ├── cimg-feature-request.md │ └── config.yml └── pull_request_template.md ├── .gitmodules ├── 20.04 └── Dockerfile ├── 22.04 └── Dockerfile ├── 24.04 └── Dockerfile ├── Dockerfile.template ├── GEN-CHECK ├── LICENSE ├── README.md ├── build-base-images.sh ├── build-images.sh ├── build-monthly-images.sh ├── img ├── circle-circleci.svg ├── circle-docker.svg └── circle-ubuntu.svg ├── manifest ├── push-base-images.sh ├── push-images.sh └── push-monthly-images.sh /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | cimg: circleci/cimg@0.6.5 5 | 6 | parameters: 7 | cron: 8 | type: boolean 9 | default: false 10 | 11 | workflows: 12 | monthly-release: 13 | when: << pipeline.parameters.cron >> 14 | # Publishes the `YYYY.MM` tag as well as the `current` tag 15 | jobs: 16 | - publish-monthly: 17 | context: 18 | - slack-notification-access-token 19 | - slack-cimg-notifications 20 | - cimg-docker-image-building 21 | - cimg-docker-image-publishing 22 | main: 23 | when: 24 | not: << pipeline.parameters.cron >> 25 | # Always runs. When the main branch runs, publishes the `edge` Docker tag 26 | jobs: 27 | - cimg/build-and-deploy: 28 | name: "Test" 29 | resource-class: 2xlarge+ 30 | docker-namespace: ccitest 31 | docker-repository: base 32 | filters: 33 | branches: 34 | ignore: 35 | - main 36 | context: 37 | - slack-notification-access-token 38 | - slack-cimg-notifications 39 | - cimg-docker-image-building 40 | - cimg/build-and-deploy: 41 | name: "Deploy" 42 | resource-class: 2xlarge+ 43 | docker-repository: base 44 | filters: 45 | branches: 46 | only: 47 | - main 48 | context: 49 | - slack-notification-access-token 50 | - slack-cimg-notifications 51 | - cimg-docker-image-building 52 | - cimg-docker-image-publishing 53 | - publish-edge: 54 | filters: 55 | branches: 56 | only: main 57 | context: 58 | - slack-notification-access-token 59 | - slack-cimg-notifications 60 | - cimg-docker-image-building 61 | - cimg-docker-image-publishing 62 | manual-monthly: 63 | when: 64 | not: << pipeline.parameters.cron >> 65 | # Used to respin this month's snapshot 66 | jobs: 67 | - publish-monthly: 68 | filters: 69 | tags: 70 | only: /^monthly$/ 71 | branches: 72 | ignore: /.*/ 73 | context: 74 | - slack-notification-access-token 75 | - slack-cimg-notifications 76 | - cimg-docker-image-building 77 | - cimg-docker-image-publishing 78 | 79 | commands: 80 | setup-buildx-deps: 81 | steps: 82 | - run: 83 | name: "Install Docker buildx dependencies" 84 | command: | 85 | sudo apt-get update 86 | sudo apt-get install -y qemu-user-static binfmt-support 87 | 88 | jobs: 89 | publish-edge: 90 | machine: 91 | image: ubuntu-2204:current 92 | resource_class: 2xlarge+ 93 | steps: 94 | - checkout 95 | - setup-buildx-deps 96 | - run: 97 | name: "Build & Tag Images" 98 | command: | 99 | ./build-base-images.sh 100 | - run: 101 | name: "Publish Docker Images (main branch only)" 102 | command: | 103 | if [ "${CIRCLE_BRANCH}" == "main" ]; then 104 | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin 105 | ./push-base-images.sh 106 | fi 107 | - run: 108 | name: "Publish Docker Hub Description (main branch only)" 109 | command: | 110 | if [ "${CIRCLE_BRANCH}" == "main" ]; then 111 | 112 | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin 113 | 114 | # Update the Docker Hub description 115 | SONAR_VER=0.15.0 116 | SONAR_URL="https://github.com/felicianotech/sonar/releases/download/v${SONAR_VER}/sonar-v${SONAR_VER}-linux-amd64.tar.gz" 117 | mkdir -p $HOME/bin 118 | curl -sSL $SONAR_URL | tar -xz -C $HOME/bin sonar 119 | 120 | # sonar requres "DOCKER_PASS" to be set 121 | export DOCKER_PASS=$DOCKER_TOKEN 122 | 123 | sonar set description cimg/base ./README.md 124 | fi 125 | 126 | publish-monthly: 127 | machine: 128 | image: ubuntu-2204:current 129 | resource_class: 2xlarge+ 130 | steps: 131 | - checkout 132 | - setup-buildx-deps 133 | - run: 134 | name: "Build & Tag Images" 135 | command: | 136 | # This script is currently edited by hand 137 | ./build-monthly-images.sh 138 | - run: 139 | name: "Publish Docker Images (main branch only)" 140 | command: | 141 | if [ "${CIRCLE_BRANCH}" == "main" ] || [ "${CIRCLE_TAG}" == "monthly" ]; then 142 | echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin 143 | ./push-monthly-images.sh 144 | fi 145 | -------------------------------------------------------------------------------- /.circleci/schedule.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Monthly Snapshot", 3 | "description": "Kickoff a pipeline to publish new monthly snapshots of the base image.", 4 | "parameters": { 5 | "branch": "main", 6 | "cron": true 7 | }, 8 | "timetable": { 9 | "per-hour": 1, 10 | "hours-of-day": [10], 11 | "days-of-week": ["MON"] 12 | }, 13 | "attribution-actor": "system" 14 | } 15 | -------------------------------------------------------------------------------- /.circleci/update-schedule.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | curl --location --request POST \ 4 | "https://circleci.com/api/v2/project/gh/CircleCI-Public/cimg-base/schedule" \ 5 | --header "Circle-Token: $CIRCLECI_TOKEN" \ 6 | --header 'Content-Type: application/json' \ 7 | --data-raw "$(cat schedule.json)" 8 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @CircleCI-Public/images 2 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | # CircleCI Docker Convenience Image Contributions 2 | 3 | We welcome all contributions to our CircleCI Docker Convenience Image repositories from the community! 4 | 5 | This file outlines best practices for contributions and what you can expect from the images team at CircleCI. 6 | 7 | ## Image Support Policy 8 | 9 | For our official CircleCI Docker Convenience Image support policy, please see [CircleCI docs](https://circleci.com/docs/convenience-images-support-policy). 10 | 11 | This policy outlines the release, update, and deprecation policy for CircleCI Docker Convenience Images. 12 | 13 | ## Issues 14 | 15 | Please open issues for feature requests and bug reports. Depending on the type of issue, please fill out the issue template with as much information as possible. 16 | 17 | The more information you can provide about your issue, the better we can help address the issue promptly! 18 | 19 | For feature requests, in order for us to add a tool within the image, it has to be something that is maintained and useful to a majority of CircleCI users. Every tool added makes the image larger and slower for all users, so any new additions need to be carefully thought out. 20 | 21 | While we make every effort to respond to issues quickly, however please note that we do not provide an official SLA for this. 22 | 23 | ## Contributions and Pull Requests 24 | 25 | When making changes to CircleCI Docker Convenience Images, please only make these changes in the `Dockerfile.template` file in the root of the repository. 26 | 27 | Our build and releases scripts generate new Dockerfiles based on the `Dockerfile.template` file and overwrite the Dockerfiles in the version directories. Therefore, only changes made to the `Dockerfile.template` file will be valid for a pull request as changes to other files will be lost. 28 | 29 | Additionally, please do not make changes to any of the build or push bash script files as these are also automatically generated. 30 | 31 | Ensure extra layers are not added to the Dockerfile where it is not necessary. We aim to keep layer count low to ensure good caching in the CircleCI execution environment. 32 | 33 | Please fill out the pull request template when opening a new pull request. This helps us to look into new pull requests in a timely manner. 34 | 35 | While we make every effort to respond to pull requests quickly, however please note that we do not provide an official SLA for this. 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/cimg-bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a bug report for this image 4 | title: 'Bug Report: ' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | *Note: We also welcome PRs to fix bugs! This helps us take action faster where a bug has been identified!* 11 | 12 | For our official CircleCI Docker Convenience Image support policy, please see [CircleCI docs](https://circleci.com/docs/convenience-images-support-policy). 13 | 14 | This policy outlines the release, update, and deprecation policy for CircleCI Docker Convenience Images. 15 | 16 | --- 17 | 18 | **Describe the bug** 19 | A clear and concise description of what the bug is. 20 | 21 | **To Reproduce** 22 | Please provide steps to reproduce the behavior, such as a sample job or config file. 23 | 24 | **Expected behavior** 25 | A clear and concise description of what you expected to happen. 26 | 27 | **Workarounds** 28 | Are there any current workarounds for this bug that can be used currently? 29 | 30 | **Screenshots and Build Links** 31 | If possible, add screenshots and links to jobs to help explain your problem. 32 | 33 | **Additional context** 34 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/cimg-feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Create a feature / enhancement request for this image 4 | title: 'Feature Request: ' 5 | labels: 'enhancement' 6 | assignees: '' 7 | 8 | --- 9 | 10 | For our official CircleCI Docker Convenience Image support policy, please see [CircleCI docs](https://circleci.com/docs/convenience-images-support-policy). 11 | 12 | This policy outlines the release, update, and deprecation policy for CircleCI Docker Convenience Images. 13 | 14 | --- 15 | 16 | **Describe the Feature Request** 17 | Please describe the feature request. 18 | 19 | **Is your feature request related to a particular problem?** 20 | A clear and concise description of what the problem is. 21 | 22 | **How will this feature request benefit CircleCI jobs using this image?** 23 | For example, will it help speed up jobs significantly by not having to install a commonly used package every run? 24 | 25 | In order for us to add a tool within the image, it has to be something that is maintained and useful to a majority of CircleCI users. Every tool added makes the image larger and slower for all users, so any new additions need to be carefully thought out. 26 | 27 | **Describe the solution you would like to see** 28 | A clear and concise description of what you would like to see for this feature request. For example "I like like to see xyz package installed by default in the image". 29 | 30 | **Describe alternatives you have considered** 31 | A clear and concise description of any alternative solutions you have considered, such as different packages or workarounds. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: CircleCI Discuss Community Forum 4 | url: https://discuss.circleci.com 5 | about: Community forum for CircleCI users -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | For our official CircleCI Docker Convenience Image support policy, please see [CircleCI docs](https://circleci.com/docs/convenience-images-support-policy). 2 | 3 | This policy outlines the release, update, and deprecation policy for CircleCI Docker Convenience Images. 4 | 5 | --- 6 | 7 | # Description 8 | A brief description of the changes in this PR. 9 | 10 | # Reasons 11 | Please provide reasoning for these changes and how this PR achieves them. 12 | 13 | If applicable, include a link to the related GitHub issue that this PR will close. 14 | 15 | # Checklist 16 | 17 | Please check through the following before opening your PR. Thank you! 18 | 19 | - [ ] I have made changes to the `Dockerfile.template` file only 20 | - [ ] I have not made any manual changes to automatically generated files 21 | - [ ] My PR follows best practices as described in the [contributing guidelines](CONTRIBUTING) 22 | - [ ] (Optional, but recommended) My commits are [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) 23 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "shared"] 2 | path = shared 3 | url = git@github.com:CircleCI-Public/cimg-shared.git 4 | -------------------------------------------------------------------------------- /20.04/Dockerfile: -------------------------------------------------------------------------------- 1 | # vim:set ft=dockerfile: 2 | 3 | # Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles. 4 | 5 | FROM ubuntu:20.04 6 | 7 | LABEL maintainer="CircleCI Execution Team " 8 | 9 | # Change default shell for RUN from Dash to Bash 10 | SHELL ["/bin/bash", "-exo", "pipefail", "-c"] 11 | 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | TERM=dumb \ 14 | PAGER=cat 15 | 16 | # Configure environment 17 | RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \ 18 | echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci && \ 19 | apt-get update && apt-get install -y \ 20 | curl \ 21 | locales \ 22 | sudo \ 23 | && \ 24 | locale-gen en_US.UTF-8 && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | groupadd --gid=1002 circleci && \ 28 | useradd --uid=1001 --gid=circleci --create-home circleci && \ 29 | echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci && \ 30 | echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep && \ 31 | sudo -u circleci mkdir /home/circleci/project && \ 32 | sudo -u circleci mkdir /home/circleci/bin && \ 33 | sudo -u circleci mkdir -p /home/circleci/.local/bin && \ 34 | \ 35 | dockerizeArch=arm64 && \ 36 | if uname -p | grep "x86_64"; then \ 37 | dockerizeArch=x86_64; \ 38 | fi && \ 39 | curl -sSL --fail --retry 3 --output /usr/local/bin/dockerize "https://github.com/powerman/dockerize/releases/download/v0.8.0/dockerize-linux-${dockerizeArch}" && \ 40 | chmod +x /usr/local/bin/dockerize && \ 41 | dockerize --version 42 | 43 | ENV PATH=/home/circleci/bin:/home/circleci/.local/bin:$PATH \ 44 | LANG=en_US.UTF-8 \ 45 | LANGUAGE=en_US:en \ 46 | LC_ALL=en_US.UTF-8 47 | 48 | RUN noInstallRecommends="" && \ 49 | if [[ "20.04" == "22.04" || "20.04" == "24.04" ]]; then \ 50 | noInstallRecommends="--no-install-recommends"; \ 51 | fi && \ 52 | apt-get update && apt-get install -y $noInstallRecommends \ 53 | autoconf \ 54 | build-essential \ 55 | ca-certificates \ 56 | cmake \ 57 | # already installed but here for consistency 58 | curl \ 59 | file \ 60 | gettext-base \ 61 | gnupg \ 62 | gzip \ 63 | jq \ 64 | libcurl4-openssl-dev \ 65 | libmagic-dev \ 66 | # popular DB lib - MariaDB 67 | libmariadb-dev \ 68 | # allows MySQL users to use MariaDB lib 69 | libmariadb-dev-compat \ 70 | # popular DB lib - PostgreSQL 71 | libpq-dev \ 72 | libssl-dev \ 73 | libsqlite3-dev \ 74 | lsof \ 75 | make \ 76 | # for ssh-enabled builds 77 | nano \ 78 | net-tools \ 79 | netcat-openbsd \ 80 | openssh-client \ 81 | parallel \ 82 | # compiling tool 83 | pkg-config \ 84 | postgresql-client \ 85 | python-is-python3 \ 86 | retry \ 87 | shellcheck \ 88 | software-properties-common \ 89 | # already installed but here for consistency 90 | sudo \ 91 | tar \ 92 | tzdata \ 93 | unzip \ 94 | # for ssh-enabled builds 95 | vim \ 96 | wget \ 97 | zip && \ 98 | # get the semi-official latest-stable git instead of using the old(er) version from the ubuntu distro 99 | add-apt-repository ppa:git-core/ppa && apt-get install -y git && \ 100 | # get the semi-official latest-stable git-lfs too 101 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install -y git-lfs && \ 102 | # Quick test of the git & git-lfs install 103 | git version && git lfs version && \ 104 | # Smoke test for python aliasing 105 | python --version && \ 106 | rm -rf /var/lib/apt/lists/* 107 | 108 | # Install Docker - needs the setup_remote_docker CircleCI step to work 109 | ENV DOCKER_VERSION=5:28.1.1-1~ubuntu 110 | RUN apt-get update && apt-get install -y \ 111 | apt-transport-https \ 112 | ca-certificates \ 113 | curl \ 114 | gnupg-agent \ 115 | software-properties-common && \ 116 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ 117 | add-apt-repository -y "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $( lsb_release -cs ) stable" && \ 118 | apt-get install -y docker-ce=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) docker-ce-cli=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) containerd.io && \ 119 | # Quick test of the Docker install 120 | docker --version && \ 121 | rm -rf /var/lib/apt/lists/* 122 | 123 | # Install Docker Compose - see prerequisite above 124 | ENV COMPOSE_VER 2.27.1 125 | ENV COMPOSE_SWITCH_VERSION 1.0.5 126 | RUN dockerPluginDir=/usr/local/lib/docker/cli-plugins && \ 127 | mkdir -p $dockerPluginDir && \ 128 | curl -sSL "https://github.com/docker/compose/releases/download/v${COMPOSE_VER}/docker-compose-linux-$(uname -m)" -o $dockerPluginDir/docker-compose && \ 129 | chmod +x $dockerPluginDir/docker-compose && \ 130 | curl -fL "https://github.com/docker/compose-switch/releases/download/v${COMPOSE_SWITCH_VERSION}/docker-compose-linux-$(dpkg --print-architecture)" -o /usr/local/bin/compose-switch && \ 131 | # Quick test of the Docker Compose install 132 | docker compose version && \ 133 | chmod +x /usr/local/bin/compose-switch && \ 134 | update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99 && \ 135 | # Tests if docker-compose for v1 is transposed to v2 136 | docker-compose version 137 | 138 | RUN YQ_ARCH=$(dpkg --print-architecture) && \ 139 | curl -sSL "https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$YQ_ARCH.tar.gz" | \ 140 | tar -xz -C /usr/local/bin && \ 141 | mv /usr/local/bin/yq{_linux_$YQ_ARCH,} 142 | 143 | USER circleci 144 | # Run commands and tests as circleci user 145 | RUN whoami && \ 146 | # opt-out of the new security feature, not needed in a CI environment 147 | git config --global --add safe.directory '*' 148 | 149 | # Match the default CircleCI working directory 150 | WORKDIR /home/circleci/project 151 | -------------------------------------------------------------------------------- /22.04/Dockerfile: -------------------------------------------------------------------------------- 1 | # vim:set ft=dockerfile: 2 | 3 | # Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles. 4 | 5 | FROM ubuntu:22.04 6 | 7 | LABEL maintainer="CircleCI Execution Team " 8 | 9 | # Change default shell for RUN from Dash to Bash 10 | SHELL ["/bin/bash", "-exo", "pipefail", "-c"] 11 | 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | TERM=dumb \ 14 | PAGER=cat 15 | 16 | # Configure environment 17 | RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \ 18 | echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci && \ 19 | apt-get update && apt-get install -y \ 20 | curl \ 21 | locales \ 22 | sudo \ 23 | && \ 24 | locale-gen en_US.UTF-8 && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | groupadd --gid=1002 circleci && \ 28 | useradd --uid=1001 --gid=circleci --create-home circleci && \ 29 | echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci && \ 30 | echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep && \ 31 | sudo -u circleci mkdir /home/circleci/project && \ 32 | sudo -u circleci mkdir /home/circleci/bin && \ 33 | sudo -u circleci mkdir -p /home/circleci/.local/bin && \ 34 | \ 35 | dockerizeArch=arm64 && \ 36 | if uname -p | grep "x86_64"; then \ 37 | dockerizeArch=x86_64; \ 38 | fi && \ 39 | curl -sSL --fail --retry 3 --output /usr/local/bin/dockerize "https://github.com/powerman/dockerize/releases/download/v0.8.0/dockerize-linux-${dockerizeArch}" && \ 40 | chmod +x /usr/local/bin/dockerize && \ 41 | dockerize --version 42 | 43 | ENV PATH=/home/circleci/bin:/home/circleci/.local/bin:$PATH \ 44 | LANG=en_US.UTF-8 \ 45 | LANGUAGE=en_US:en \ 46 | LC_ALL=en_US.UTF-8 47 | 48 | RUN apt-get update && apt-get install -y --no-install-recommends \ 49 | autoconf \ 50 | build-essential \ 51 | ca-certificates \ 52 | cmake \ 53 | # already installed but here for consistency 54 | curl \ 55 | file \ 56 | gettext-base \ 57 | gnupg \ 58 | gzip \ 59 | jq \ 60 | libcurl4-openssl-dev \ 61 | libmagic-dev \ 62 | # popular DB lib - MariaDB 63 | libmariadb-dev \ 64 | # allows MySQL users to use MariaDB lib 65 | libmariadb-dev-compat \ 66 | # popular DB lib - PostgreSQL 67 | libpq-dev \ 68 | libssl-dev \ 69 | libsqlite3-dev \ 70 | lsof \ 71 | make \ 72 | # for ssh-enabled builds 73 | nano \ 74 | net-tools \ 75 | netcat-openbsd \ 76 | openssh-client \ 77 | parallel \ 78 | # compiling tool 79 | pkg-config \ 80 | postgresql-client \ 81 | python-is-python3 \ 82 | retry \ 83 | shellcheck \ 84 | software-properties-common \ 85 | # already installed but here for consistency 86 | sudo \ 87 | tar \ 88 | tzdata \ 89 | unzip \ 90 | # for ssh-enabled builds 91 | vim \ 92 | wget \ 93 | zip && \ 94 | # get the semi-official latest-stable git instead of using the old(er) version from the ubuntu distro 95 | add-apt-repository ppa:git-core/ppa && apt-get install -y git && \ 96 | # get the semi-official latest-stable git-lfs too 97 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install -y git-lfs && \ 98 | # Quick test of the git & git-lfs install 99 | git version && git lfs version && \ 100 | # Smoke test for python aliasing 101 | python --version && \ 102 | rm -rf /var/lib/apt/lists/* 103 | 104 | # Install Docker - needs the setup_remote_docker CircleCI step to work 105 | ENV DOCKER_VERSION=5:28.1.1-1~ubuntu 106 | RUN apt-get update && apt-get install -y \ 107 | apt-transport-https \ 108 | ca-certificates \ 109 | curl \ 110 | gnupg-agent \ 111 | software-properties-common && \ 112 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ 113 | add-apt-repository -y "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $( lsb_release -cs ) stable" && \ 114 | apt-get install -y docker-ce=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) docker-ce-cli=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) containerd.io && \ 115 | # Quick test of the Docker install 116 | docker --version && \ 117 | rm -rf /var/lib/apt/lists/* 118 | 119 | # Install Docker Compose - see prerequisite above 120 | ENV COMPOSE_VER 2.27.1 121 | ENV COMPOSE_SWITCH_VERSION 1.0.5 122 | RUN dockerPluginDir=/usr/local/lib/docker/cli-plugins && \ 123 | mkdir -p $dockerPluginDir && \ 124 | curl -sSL "https://github.com/docker/compose/releases/download/v${COMPOSE_VER}/docker-compose-linux-$(uname -m)" -o $dockerPluginDir/docker-compose && \ 125 | chmod +x $dockerPluginDir/docker-compose && \ 126 | curl -fL "https://github.com/docker/compose-switch/releases/download/v${COMPOSE_SWITCH_VERSION}/docker-compose-linux-$(dpkg --print-architecture)" -o /usr/local/bin/compose-switch && \ 127 | # Quick test of the Docker Compose install 128 | docker compose version && \ 129 | chmod +x /usr/local/bin/compose-switch && \ 130 | update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99 && \ 131 | # Tests if docker-compose for v1 is transposed to v2 132 | docker-compose version 133 | 134 | RUN YQ_ARCH=$(dpkg --print-architecture) && \ 135 | curl -sSL "https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$YQ_ARCH.tar.gz" | \ 136 | tar -xz -C /usr/local/bin && \ 137 | mv /usr/local/bin/yq{_linux_$YQ_ARCH,} 138 | 139 | USER circleci 140 | # Run commands and tests as circleci user 141 | RUN whoami && \ 142 | # opt-out of the new security feature, not needed in a CI environment 143 | git config --global --add safe.directory '*' 144 | 145 | # Match the default CircleCI working directory 146 | WORKDIR /home/circleci/project 147 | -------------------------------------------------------------------------------- /24.04/Dockerfile: -------------------------------------------------------------------------------- 1 | # vim:set ft=dockerfile: 2 | 3 | # Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles. 4 | 5 | FROM ubuntu:24.04 6 | 7 | LABEL maintainer="CircleCI Execution Team " 8 | 9 | # Change default shell for RUN from Dash to Bash 10 | SHELL ["/bin/bash", "-exo", "pipefail", "-c"] 11 | 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | TERM=dumb \ 14 | PAGER=cat 15 | 16 | # Configure environment 17 | RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \ 18 | echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci && \ 19 | apt-get update && apt-get install -y \ 20 | curl \ 21 | locales \ 22 | sudo \ 23 | && \ 24 | locale-gen en_US.UTF-8 && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | groupadd --gid=1002 circleci && \ 28 | useradd --uid=1001 --gid=circleci --create-home circleci && \ 29 | echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci && \ 30 | echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep && \ 31 | sudo -u circleci mkdir /home/circleci/project && \ 32 | sudo -u circleci mkdir /home/circleci/bin && \ 33 | sudo -u circleci mkdir -p /home/circleci/.local/bin && \ 34 | \ 35 | dockerizeArch=arm64 && \ 36 | if uname -p | grep "x86_64"; then \ 37 | dockerizeArch=x86_64; \ 38 | fi && \ 39 | curl -sSL --fail --retry 3 --output /usr/local/bin/dockerize "https://github.com/powerman/dockerize/releases/download/v0.8.0/dockerize-linux-${dockerizeArch}" && \ 40 | chmod +x /usr/local/bin/dockerize && \ 41 | dockerize --version 42 | 43 | ENV PATH=/home/circleci/bin:/home/circleci/.local/bin:$PATH \ 44 | LANG=en_US.UTF-8 \ 45 | LANGUAGE=en_US:en \ 46 | LC_ALL=en_US.UTF-8 47 | 48 | RUN apt-get update && apt-get install -y --no-install-recommends \ 49 | autoconf \ 50 | build-essential \ 51 | ca-certificates \ 52 | cmake \ 53 | # already installed but here for consistency 54 | curl \ 55 | file \ 56 | gettext-base \ 57 | gnupg \ 58 | gzip \ 59 | jq \ 60 | libcurl4-openssl-dev \ 61 | libmagic-dev \ 62 | # popular DB lib - MariaDB 63 | libmariadb-dev \ 64 | # allows MySQL users to use MariaDB lib 65 | libmariadb-dev-compat \ 66 | # popular DB lib - PostgreSQL 67 | libpq-dev \ 68 | libssl-dev \ 69 | libsqlite3-dev \ 70 | lsof \ 71 | make \ 72 | # for ssh-enabled builds 73 | nano \ 74 | net-tools \ 75 | netcat-openbsd \ 76 | openssh-client \ 77 | parallel \ 78 | # compiling tool 79 | pkg-config \ 80 | postgresql-client \ 81 | python-is-python3 \ 82 | retry \ 83 | shellcheck \ 84 | software-properties-common \ 85 | # already installed but here for consistency 86 | sudo \ 87 | tar \ 88 | tzdata \ 89 | unzip \ 90 | # for ssh-enabled builds 91 | vim \ 92 | wget \ 93 | zip && \ 94 | # get the semi-official latest-stable git instead of using the old(er) version from the ubuntu distro 95 | add-apt-repository ppa:git-core/ppa && apt-get install -y git && \ 96 | # get the semi-official latest-stable git-lfs too 97 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install -y git-lfs && \ 98 | # Quick test of the git & git-lfs install 99 | git version && git lfs version && \ 100 | # Smoke test for python aliasing 101 | python --version && \ 102 | rm -rf /var/lib/apt/lists/* 103 | 104 | # Install Docker - needs the setup_remote_docker CircleCI step to work 105 | ENV DOCKER_VERSION=5:28.1.1-1~ubuntu 106 | RUN apt-get update && apt-get install -y \ 107 | apt-transport-https \ 108 | ca-certificates \ 109 | curl \ 110 | gnupg-agent \ 111 | software-properties-common && \ 112 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ 113 | add-apt-repository -y "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $( lsb_release -cs ) stable" && \ 114 | apt-get install -y docker-ce=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) docker-ce-cli=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) containerd.io && \ 115 | # Quick test of the Docker install 116 | docker --version && \ 117 | rm -rf /var/lib/apt/lists/* 118 | 119 | # Install Docker Compose - see prerequisite above 120 | ENV COMPOSE_VER 2.27.1 121 | ENV COMPOSE_SWITCH_VERSION 1.0.5 122 | RUN dockerPluginDir=/usr/local/lib/docker/cli-plugins && \ 123 | mkdir -p $dockerPluginDir && \ 124 | curl -sSL "https://github.com/docker/compose/releases/download/v${COMPOSE_VER}/docker-compose-linux-$(uname -m)" -o $dockerPluginDir/docker-compose && \ 125 | chmod +x $dockerPluginDir/docker-compose && \ 126 | curl -fL "https://github.com/docker/compose-switch/releases/download/v${COMPOSE_SWITCH_VERSION}/docker-compose-linux-$(dpkg --print-architecture)" -o /usr/local/bin/compose-switch && \ 127 | # Quick test of the Docker Compose install 128 | docker compose version && \ 129 | chmod +x /usr/local/bin/compose-switch && \ 130 | update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99 && \ 131 | # Tests if docker-compose for v1 is transposed to v2 132 | docker-compose version 133 | 134 | RUN YQ_ARCH=$(dpkg --print-architecture) && \ 135 | curl -sSL "https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$YQ_ARCH.tar.gz" | \ 136 | tar -xz -C /usr/local/bin && \ 137 | mv /usr/local/bin/yq{_linux_$YQ_ARCH,} 138 | 139 | USER circleci 140 | # Run commands and tests as circleci user 141 | RUN whoami && \ 142 | # opt-out of the new security feature, not needed in a CI environment 143 | git config --global --add safe.directory '*' 144 | 145 | # Match the default CircleCI working directory 146 | WORKDIR /home/circleci/project 147 | -------------------------------------------------------------------------------- /Dockerfile.template: -------------------------------------------------------------------------------- 1 | # vim:set ft=dockerfile: 2 | 3 | # Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles. 4 | 5 | FROM %%PARENT%%:%%VERSION_FULL%% 6 | 7 | LABEL maintainer="CircleCI Execution Team " 8 | 9 | # Change default shell for RUN from Dash to Bash 10 | SHELL ["/bin/bash", "-exo", "pipefail", "-c"] 11 | 12 | ENV DEBIAN_FRONTEND=noninteractive \ 13 | TERM=dumb \ 14 | PAGER=cat 15 | 16 | # Configure environment 17 | RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci && \ 18 | echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci && \ 19 | apt-get update && apt-get install -y \ 20 | curl \ 21 | locales \ 22 | sudo \ 23 | && \ 24 | locale-gen en_US.UTF-8 && \ 25 | rm -rf /var/lib/apt/lists/* && \ 26 | \ 27 | groupadd --gid=1002 circleci && \ 28 | useradd --uid=1001 --gid=circleci --create-home circleci && \ 29 | echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci && \ 30 | echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep && \ 31 | sudo -u circleci mkdir /home/circleci/project && \ 32 | sudo -u circleci mkdir /home/circleci/bin && \ 33 | sudo -u circleci mkdir -p /home/circleci/.local/bin && \ 34 | \ 35 | dockerizeArch=arm64 && \ 36 | if uname -p | grep "x86_64"; then \ 37 | dockerizeArch=x86_64; \ 38 | fi && \ 39 | curl -sSL --fail --retry 3 --output /usr/local/bin/dockerize "https://github.com/powerman/dockerize/releases/download/v0.8.0/dockerize-linux-${dockerizeArch}" && \ 40 | chmod +x /usr/local/bin/dockerize && \ 41 | dockerize --version 42 | 43 | ENV PATH=/home/circleci/bin:/home/circleci/.local/bin:$PATH \ 44 | LANG=en_US.UTF-8 \ 45 | LANGUAGE=en_US:en \ 46 | LC_ALL=en_US.UTF-8 47 | 48 | RUN apt-get update && apt-get install -y --no-install-recommends \ 49 | autoconf \ 50 | build-essential \ 51 | ca-certificates \ 52 | cmake \ 53 | # already installed but here for consistency 54 | curl \ 55 | file \ 56 | gettext-base \ 57 | gnupg \ 58 | gzip \ 59 | jq \ 60 | libcurl4-openssl-dev \ 61 | libmagic-dev \ 62 | # popular DB lib - MariaDB 63 | libmariadb-dev \ 64 | # allows MySQL users to use MariaDB lib 65 | libmariadb-dev-compat \ 66 | # popular DB lib - PostgreSQL 67 | libpq-dev \ 68 | libssl-dev \ 69 | libsqlite3-dev \ 70 | lsof \ 71 | make \ 72 | # for ssh-enabled builds 73 | nano \ 74 | net-tools \ 75 | netcat-openbsd \ 76 | openssh-client \ 77 | parallel \ 78 | # compiling tool 79 | pkg-config \ 80 | postgresql-client \ 81 | python-is-python3 \ 82 | retry \ 83 | shellcheck \ 84 | software-properties-common \ 85 | # already installed but here for consistency 86 | sudo \ 87 | tar \ 88 | tzdata \ 89 | unzip \ 90 | # for ssh-enabled builds 91 | vim \ 92 | wget \ 93 | zip && \ 94 | # get the semi-official latest-stable git instead of using the old(er) version from the ubuntu distro 95 | add-apt-repository ppa:git-core/ppa && apt-get install -y git && \ 96 | # get the semi-official latest-stable git-lfs too 97 | curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install -y git-lfs && \ 98 | # Quick test of the git & git-lfs install 99 | git version && git lfs version && \ 100 | # Smoke test for python aliasing 101 | python --version && \ 102 | rm -rf /var/lib/apt/lists/* 103 | 104 | # Install Docker - needs the setup_remote_docker CircleCI step to work 105 | ENV DOCKER_VERSION=5:28.1.1-1~ubuntu 106 | RUN apt-get update && apt-get install -y \ 107 | apt-transport-https \ 108 | ca-certificates \ 109 | curl \ 110 | gnupg-agent \ 111 | software-properties-common && \ 112 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ 113 | add-apt-repository -y "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $( lsb_release -cs ) stable" && \ 114 | apt-get install -y docker-ce=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) docker-ce-cli=${DOCKER_VERSION}.$( lsb_release -rs )~$( lsb_release -cs ) containerd.io && \ 115 | # Quick test of the Docker install 116 | docker --version && \ 117 | rm -rf /var/lib/apt/lists/* 118 | 119 | # Install Docker Compose - see prerequisite above 120 | ENV COMPOSE_VER 2.27.1 121 | ENV COMPOSE_SWITCH_VERSION 1.0.5 122 | RUN dockerPluginDir=/usr/local/lib/docker/cli-plugins && \ 123 | mkdir -p $dockerPluginDir && \ 124 | curl -sSL "https://github.com/docker/compose/releases/download/v${COMPOSE_VER}/docker-compose-linux-$(uname -m)" -o $dockerPluginDir/docker-compose && \ 125 | chmod +x $dockerPluginDir/docker-compose && \ 126 | curl -fL "https://github.com/docker/compose-switch/releases/download/v${COMPOSE_SWITCH_VERSION}/docker-compose-linux-$(dpkg --print-architecture)" -o /usr/local/bin/compose-switch && \ 127 | # Quick test of the Docker Compose install 128 | docker compose version && \ 129 | chmod +x /usr/local/bin/compose-switch && \ 130 | update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99 && \ 131 | # Tests if docker-compose for v1 is transposed to v2 132 | docker-compose version 133 | 134 | RUN YQ_ARCH=$(dpkg --print-architecture) && \ 135 | curl -sSL "https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$YQ_ARCH.tar.gz" | \ 136 | tar -xz -C /usr/local/bin && \ 137 | mv /usr/local/bin/yq{_linux_$YQ_ARCH,} 138 | 139 | USER circleci 140 | # Run commands and tests as circleci user 141 | RUN whoami && \ 142 | # opt-out of the new security feature, not needed in a CI environment 143 | git config --global --add safe.directory '*' 144 | 145 | # Match the default CircleCI working directory 146 | WORKDIR /home/circleci/project 147 | -------------------------------------------------------------------------------- /GEN-CHECK: -------------------------------------------------------------------------------- 1 | GEN_CHECK=(22.04 24.04) 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright ©2019-2021 CircleCI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

3 | CircleCI Logo 4 | Docker Logo 5 | Ubuntu Logo 6 |

7 |

CircleCI Convenience Images => Base

8 |

A Continous Integration focused Ubuntu Docker image built to run on CircleCI

9 |
10 | 11 | [![CircleCI Build Status](https://circleci.com/gh/CircleCI-Public/cimg-base.svg?style=shield)](https://circleci.com/gh/CircleCI-Public/cimg-base) [![Software License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/CircleCI-Public/cimg-base/main/LICENSE) [![Docker Pulls](https://img.shields.io/docker/pulls/cimg/base)](https://hub.docker.com/r/cimg/base) [![CircleCI Community](https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg)](https://discuss.circleci.com/c/ecosystem/circleci-images) [![Repository](https://img.shields.io/badge/github-README-brightgreen)](https://github.com/CircleCI-Public/cimg-base) 12 | 13 | [![InsightsSnapshot](https://dl.circleci.com/insights-snapshot/gh/CircleCI-Public/cimg-base/main/main/badge.svg)](https://app.circleci.com/insights/github/CircleCI-Public/cimg-base/workflows/main?branch=main) 14 | 15 | `cimg/base` is an Ubuntu Docker image created by CircleCI with continuous integration builds in mind. 16 | As its name suggests, this image is designed to serve as a base image for other CircleCI Convenience Images (images prefixed with `cimg/`). 17 | 18 | This image is also very useful for CircleCI users to use as a base for their own custom Docker images. 19 | 20 | This image contains the minimum tools required to operate a build on CircleCI (such as `git`) as well as extremely popular and useful tools in CircleCI (such as `docker`). 21 | 22 | ## Support Policy 23 | 24 | The CircleCI Docker Convenience Image support policy can be found on the [CircleCI docs](https://circleci.com/docs/convenience-images-support-policy) site. This policy outlines the release, update, and deprecation policy for CircleCI Docker Convenience Images. 25 | 26 | ## Table of Contents 27 | 28 | - [Getting Started](#getting-started) 29 | - [How This Image Works](#how-this-image-works) 30 | - [Development](#development) 31 | - [Contributing](#contributing) 32 | - [Additional Resources](#additional-resources) 33 | - [License](#license) 34 | 35 | ## Getting Started 36 | 37 | This image can be used with the CircleCI `docker` executor. 38 | For example: 39 | 40 | ```yaml 41 | jobs: 42 | build: 43 | docker: 44 | - image: cimg/base:2022.09 45 | steps: 46 | - checkout 47 | # Whatever you want to do 48 | - run: sudo apt-get update && sudo apt-get install -y figlet 49 | - run: figlet Continuous Integration Rocks! 50 | ``` 51 | 52 | In the above example, the CircleCI Base Docker image is used for the primary container. 53 | More specifically, the tag `2022.09` indicates the dated version of the base image. 54 | See how tags work below for more information. 55 | 56 | ## How This Image Works 57 | 58 | This image contains the Ubuntu Linux operating system and everything needed to run most builds on CircleCI. 59 | This includes but is not limited to: 60 | 61 | - Git 62 | - Docker and Docker Compose 63 | - Dockerize 64 | - The `build-essential` package containing compiling tools 65 | - jq 66 | - curl, ssh, and much more 67 | 68 | ### Tagging Scheme 69 | 70 | This image has the following tagging scheme: 71 | 72 | ``` 73 | cimg/base:edge[-version] 74 | cimg/base:current[-version] 75 | cimg/base:[-version] 76 | ``` 77 | 78 | `edge` - This image tag points to the latest version of the Base image. 79 | This tag is built from the `HEAD` of the `main` branch. 80 | The `edge` tag is intended to be used as a testing version of the image with the most recent changes however not guaranteed to be all that stable 81 | Software an be added for test that might actually be removed before the next monthly snapshot.. 82 | This tag is not recommended for production software. 83 | 84 | `current` - This image tag points to the most recent monthly snapshot. 85 | This image should be used by projects that want a decent level of stability but would like to get occasional software updates. 86 | It is typically updated once a month. 87 | While not often, this tag can introduce breaking changes. 88 | 89 | `` - This image tag is a monthly snapshot of the image, referred to by the 4 digit year, dot, and a 2 digit month. 90 | For example `2022.01` would be the monthly snapshot tag from January 2022. 91 | This tag is intended for projects that are highly sensitive to changes and want the most deterministic builds possible. 92 | Unless absolutely necessary (for security for example), no breaking changes will be introduced as we don't rebuild a monthly snapshot. 93 | 94 | `-version` - This is an optional extension to the tag to specify the version of Ubuntu to use. 95 | There can be up to two options, the current LTS and the previous LTS. 96 | As of this writing, those options would be `20.04`, or `22.04`. 97 | When leaving the version out, suggested, the default version will be used. 98 | The default Ubuntu version is the newest LTS version, after it has been out for 4 months. 99 | For example, Ubuntu 20.04 came out in April 2020, so it became the default version for this image in August 2020. 100 | The previous LTS version will be supported for a year after it drops out of the default slot. 101 | 102 | ## Development 103 | 104 | Images can be built and run locally with this repository. 105 | This has the following requirements: 106 | 107 | - local machine of Linux (Ubuntu tested) or macOS 108 | - modern version of Bash (v4+) 109 | - modern version of Docker Engine (v20.10+) 110 | 111 | ### Cloning For Community Users (no write access to this repository) 112 | 113 | Fork this repository on GitHub. 114 | When you get your clone URL, you'll want to add `--recurse-submodules` to the clone command in order to populate the Git submodule contained in this repo. 115 | It would look something like this: 116 | 117 | ```bash 118 | git clone --recurse-submodules 119 | ``` 120 | 121 | If you missed this step and already cloned, you can just run `git submodule update --recursive` to populate the submodule. 122 | Then you can optionally add this repo as an upstream to your own: 123 | 124 | ```bash 125 | git remote add upstream https://github.com/CircleCI-Public/cimg-base.git 126 | ``` 127 | 128 | ### Cloning For Maintainers ( you have write access to this repository) 129 | 130 | Clone the project with the following command so that you populate the submodule: 131 | 132 | ```bash 133 | git clone --recurse-submodules git@github.com:CircleCI-Public/cimg-base.git 134 | ``` 135 | 136 | ### Generating Dockerfiles 137 | 138 | The Dockerfile in the Ubuntu version directory (i.e. `20.04/`) is already in a state to be built if you want to build a new version of this image. 139 | Running `docker build` in this directory will be enough. 140 | 141 | Changes to this image should occur in the `Dockerfile.template` file and then using the `gen-dockerfiles.sh` script, a new Dockerfile will be built. 142 | For example, you would run the following from the root of the repo: 143 | 144 | ```bash 145 | ./shared/gen-dockerfiles.sh 20.04 22.04 146 | ``` 147 | 148 | The generated Dockerfile will be located at `./20.04/Dockefile` and `./22.04/Dockerfile`. 149 | To build the first image locally and try it out, you can run the following: 150 | 151 | ```bash 152 | cd 20.04 153 | docker build -t test/base:20.04 . 154 | docker run -it test/base:20.04 bash 155 | ``` 156 | 157 | While CircleCI will only be publishing LTS versions of Ubuntu (such as 20.04 or 22.04), you are free to swap out the version number with something newer for your own personal use. 158 | 159 | ### Building the Dockerfiles 160 | 161 | To build the Docker images locally as this repository does, run the `build-images.sh` script: 162 | 163 | ```bash 164 | ./build-images.sh 165 | ``` 166 | 167 | This script needs to be run after generating the Dockerfiles first. 168 | When releasing proper images for CircleCI, this script is run from a CircleCI pipeline and not locally. 169 | 170 | ### Publishing Official Images (for Maintainers only) 171 | 172 | The individual scripts (above) can be used to create the correct files for an image, and then added to a new git branch, committed, etc. 173 | `stage` and `edge` releases are completely automated as in the monthly snapshots. 174 | The release script is included to make this process easier for LTS updates. 175 | To make an updated LTS release for this image, you would run the following from the repo root: 176 | 177 | ```bash 178 | ./shared/release.sh 20.04 179 | ``` 180 | 181 | This will automatically create a new Git branch, generate the Dockerfile(s), stage the changes, commit them, and push them to GitHub. 182 | All that would need to be done after that is: 183 | 184 | - wait for build to pass on CircleCI 185 | - review the PR 186 | - merge the PR 187 | 188 | The main branch build will then publish a release. 189 | `edge` will be updated immediately with the LTS change occurring during the next monthly release. 190 | 191 | ### Incorporating Changes 192 | 193 | How changes are incorporated into this image depends on where they come from. 194 | 195 | **build scripts** - Changes within the `./shared` submodule happen in its [own repository](https://github.com/CircleCI-Public/cimg-shared). 196 | For those changes to affect this image, the submodule needs to be updated. 197 | Typically like this: 198 | 199 | ```bash 200 | cd shared 201 | git pull 202 | cd .. 203 | git add shared 204 | git commit -m "Updating submodule for foo." 205 | ``` 206 | 207 | **Base specific changes** - Editing the `Dockerfile.template` file in this repo will modify the Go image, specifically. 208 | Don't forget that to see any of these changes locally, the `gen-dockerfiles.sh` script will need to be run again (see above). 209 | 210 | ### Fixing a Monthly Snapshot 211 | 212 | You can respin (re-release) a monthly snapshot where there's a serious bug or security issue. 213 | This can be done by tagging a commit as `monthly`. 214 | This will re-create the monthly snapshot for the current month. 215 | 216 | ## Contributing 217 | 218 | We encourage [issues](https://github.com/CircleCI-Public/cimg-base/issues) and [pull requests](https://github.com/CircleCI-Public/cimg-base/pulls) against this repository. 219 | 220 | Please check out our [contributing guide](.github/CONTRIBUTING) which outlines best practices for contributions and what you can expect from the images team at CircleCI. 221 | 222 | ## Additional Resources 223 | 224 | [CircleCI Docs](https://circleci.com/docs/) - The official CircleCI Documentation website. 225 | [CircleCI Configuration Reference](https://circleci.com/docs/2.0/configuration-reference/#section=configuration) - From CircleCI Docs, the configuration reference page is one of the most useful pages we have. 226 | It will list all of the keys and values supported in `.circleci/config.yml`. 227 | [Docker Docs](https://docs.docker.com/) - For simple projects this won't be needed but if you want to dive deeper into learning Docker, this is a great resource. 228 | 229 | ## License 230 | 231 | This repository is licensed under the MIT license. 232 | The license can be found [here](./LICENSE). 233 | -------------------------------------------------------------------------------- /build-base-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # The edge default must be edited manually 3 | 4 | docker context create cimg 5 | docker buildx create --use cimg 6 | docker buildx build --platform=linux/amd64,linux/arm64 --file 22.04/Dockerfile -t cimg/base:edge-22.04 . 7 | docker buildx build --platform=linux/amd64,linux/arm64 --file 24.04/Dockerfile -t cimg/base:edge-24.04 -t cimg/base:edge . 8 | -------------------------------------------------------------------------------- /build-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Do not edit by hand; please use build scripts/templates to make changes 3 | set -eo pipefail 4 | 5 | docker context create cimg 6 | docker buildx create --use cimg 7 | docker buildx build --platform=linux/amd64,linux/arm64 --file 22.04/Dockerfile -t cimg/base:22.04 -t cimg/base:22.04 --push . 8 | docker buildx build --platform=linux/amd64,linux/arm64 --file 24.04/Dockerfile -t cimg/base:24.04 -t cimg/base:24.04 --push . 9 | -------------------------------------------------------------------------------- /build-monthly-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # The current default must be updated manually 3 | docker context create cimg 4 | docker buildx create --use cimg 5 | 6 | VERSION=$( date +%Y.%m ) 7 | 8 | echo "The 'version' is ${VERSION}" 9 | 10 | docker buildx build --platform=linux/amd64,linux/arm64 --file 22.04/Dockerfile -t cimg/base:${VERSION}-22.04 -t cimg/base:current-22.04 . 11 | docker buildx build --platform=linux/amd64,linux/arm64 --file 24.04/Dockerfile -t cimg/base:${VERSION}-24.04 -t cimg/base:${VERSION} -t cimg/base:current-24.04 -t cimg/base:current . 12 | -------------------------------------------------------------------------------- /img/circle-circleci.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 49 | 51 | 52 | 54 | image/svg+xml 55 | 57 | 58 | 59 | 60 | 61 | 66 | 72 | 78 | 84 | 90 | 96 | 102 | 108 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /img/circle-docker.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 25 | 28 | 35 | 39 | 40 | 41 | 44 | 45 | 70 | 72 | 73 | 75 | image/svg+xml 76 | 78 | 79 | 80 | 81 | 82 | 87 | 93 | 99 | 105 | 111 | 117 | 123 | 129 | 132 | 134 | 138 | 139 | 140 | 141 | 143 | 152 | 153 | 154 | 155 | 163 | 164 | 165 | 166 | 176 | 177 | -------------------------------------------------------------------------------- /img/circle-ubuntu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 25 | 26 | 27 | 54 | 59 | 64 | 65 | 67 | 68 | 70 | image/svg+xml 71 | 73 | 74 | 75 | 76 | 77 | 82 | 88 | 94 | 100 | 106 | 112 | 118 | 124 | 129 | 130 | 140 | 141 | -------------------------------------------------------------------------------- /manifest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | repository=base 4 | parent=ubuntu 5 | variants=() 6 | namespace=cimg 7 | arm64=1 8 | -------------------------------------------------------------------------------- /push-base-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # The edge default must be updated manually 3 | 4 | docker context create cimg 5 | docker buildx create --use cimg 6 | docker buildx build --push --platform=linux/amd64,linux/arm64 --file 22.04/Dockerfile -t cimg/base:edge-22.04 . 7 | docker buildx build --push --platform=linux/amd64,linux/arm64 --file 24.04/Dockerfile -t cimg/base:edge-24.04 -t cimg/base:edge . 8 | -------------------------------------------------------------------------------- /push-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Do not edit by hand; please use build scripts/templates to make changes 3 | set -eo pipefail 4 | -------------------------------------------------------------------------------- /push-monthly-images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # The current default must be edited manually 3 | 4 | docker context create cimg 5 | docker buildx create --use cimg 6 | 7 | VERSION=$( date +%Y.%m ) 8 | 9 | docker buildx build --push --platform=linux/amd64,linux/arm64 --file 22.04/Dockerfile -t cimg/base:${VERSION}-22.04 -t cimg/base:current-22.04 . 10 | docker buildx build --push --platform=linux/amd64,linux/arm64 --file 24.04/Dockerfile -t cimg/base:${VERSION}-24.04 -t cimg/base:${VERSION} -t cimg/base:current-24.04 -t cimg/base:current . 11 | --------------------------------------------------------------------------------