This provide custom circleci build images with the needed tools and application golang and infrastructure.
The custom circleci images are stored at fr123k dockerhub registry.
This is an example how to use the circleci-base image latest version.
jobs:
build:
docker:
- image: fr123k/circleci-base:latest
This is an example how to use a circleci-base image pinned version.
jobs:
build:
docker:
- image: fr123k/circleci-base:20220214_7db2157
This contains only the listed software and can either be used directly in a circleci pipeline or as a container base image for language specific images.
Installed software
- awscli
- docker
- git
- helm
- kubectl
- python3
- pip
- terraform
- suzuki-shunsuke/github-comment
This image provide the golang building tools at the time of writing this documentation it is version 1.17.x.
Installed software
The official circleci golang image was used as a reference. cimg-go
If you have trouble building this images then disable buildkit.
export DOCKER_BUILDKIT=0
BUILD_DATE=$(date +"%Y%m%d") GIT_COMMIT=$(git rev-parse --short HEAD) make build-all
# cd <image_folder>
cd base
BUILD_DATE=$(date +"%Y%m%d") GIT_COMMIT=$(git rev-parse --short HEAD) make build
Open a Pull Request and after its merged the circleci pipeline will build all images and push them to the dockerhub registry.
Create a new image folder for example helmut
and copy the Dockerfile and the Makefile from an other image folder.
mkdir helmut
cp golang/* helmut/
Adjust the Makefile and give the image a proper name
IMAGE_NAME?=circleci-golang
# change the name of the image
IMAGE_NAME?=circleci-helmut
Adjust the Dockerfile to your needs.
# keep the definition of the BASE_IMAGE
ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN echo helmut
Adjust the circleci config.yml and add the new image to the push-images step.
jobs:
build:
docker:
...
environment:
...
resource_class: small
steps:
...
- when:
condition:
and:
- equal: [ "main", << pipeline.git.branch >> ]
steps:
- push-images:
# add the new image name here so that it will be pushed to the AWS ecr
# the naming pattern is circleci-[folder name]
image_names: "circleci-base circleci-golang circleci-helmut"
image_tag: ${CIRCLE_SHA1:0:7}