This container contains typically devops tools like Terraform, Ansible, kubectl or Helm.
2.6K
This container contains devops tools like Terraform, Ansible, kubectl or Helm.
One intent is to provide a container for developers. Just use a container to run and develop devops tasks without to take care about installing all the tools in the right versions.
id=$(docker create docker.io/isi006/devops-build-container:latest) && docker cp ${id}:/dbc . && docker rm ${id}
id=$(docker create docker.io/isi006/devops-build-container:2.3.0) && docker cp ${id}:/dbc . && docker rm ${id}
You can check this file into SCM but do not change it's content. It will be replaced with the next version.
./dbc run.~/workspace where your project directory is mounted.docker ps on your host../dbc run in the same directory starts a new shell in same container../dbc run in a different directory start a new container../dbc stop to destroy the container../dbc pull to pull a fresh image from the registry.The container has special features to support the developer scenario:
container-profile.d to your project. Every script in this directory will be sourced on startup of the container./ssh-agent and the SSH_AUTH_SOCK is set to that path.~/.ssh, ~/.azure and ~/.gnupg are also mounted in the container, to have these files in place.Put a file .dbc-conf in your project directory to run a special image of the container:
DBC_TAG=latest
DBC_IMAGE_NAME=docker.io/isi006/devops-build-container
The second intention is to use the same container in build pipelines to eleminate incompatibilities between the developer setup and the build environment.
Docker is not installed in the container. Please use alternative technologies to build containers, like Kaniko. Developers should use the local docker installation.
Put a file .dbc-ci.sh with the commands you want to run in the container in your project directory and run ./dbc run-ci in your pipeline.
The container is Ubuntu 20.04 based and comes with the following tools:
A couple of Ubuntu packages, see the first RUN in the the Dockerfile.
Installed via pip, see the requirements.txt file:
Direct downloads
If you need other tool versions, fork this repo and change the versions in build.sh and/or provide your own requirements.txt to change the Ansible/Python setup.
Then run:
$ ./build.sh
You can extend the container if you need more tools with your own Dockerfile:
FROM isi006/devops-build-container:2
# ...install what you want
# copy your code to /app
COPY ansible /app/ansible
ARG CONTAINER_VERSION
ARG CONTAINER_GIT_HASH
ARG CONTAINER_IMAGE
RUN set -e; \
echo "export CONTAINER_GIT_HASH=${CONTAINER_GIT_HASH}" >> /etc/profile.d/81-custom-image-info.sh; \
echo "export CONTAINER_VERSION=${CONTAINER_VERSION}" >> /etc/profile.d/81-custom-image-info.sh; \
echo "export CONTAINER_IMAGE=${CONTAINER_IMAGE}" >> /etc/profile.d/81-custom-image-info.sh
# copy your commands to execute on 'dbc run-ci'
COPY .dbc-ci.sh /app/.dbc-ci.sh
The app directory is special, because the entrypoint will adapt this directory für your current user (chown -R ... /app).
A custom image can come with special commands to execute in dbc run-ci. Just put a .dbc-ci.sh in the /app directory.
Providing the CONTAINER_VERSION, CONTAINER_GIT_HASH, CONTAINER_IMAGE build parameters is necessary to enable the version check on container start.
Yes, I know, there are so many missing tools...
Please feel free to send me PRs for useful extensions of the container.
docker pull isi006/devops-build-container:latest