Merge branch 'develop' into 'main'

Merging in initial revision

See merge request jamesjonesconsulting/podman-dind-like!1
This commit is contained in:
James Jones
2022-11-17 00:11:57 +00:00
3 changed files with 32 additions and 80 deletions

View File

@@ -5,45 +5,14 @@ before_script:
- dnf install -y podman-docker - dnf install -y podman-docker
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# docker-build:
# # Use the official docker image.
# # image: docker:latest
# stage: build
# # services:
# # - docker:dind
# tags:
# - big-build
# before_script:
# - dnf install -y podman-docker
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# # Default branch leaves tag empty (= latest tag)
# # All other branches are tagged with the escaped branch name (commit ref slug)
# script:
# - |
# if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
# tag=""
# echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
# else
# tag=":$CI_COMMIT_REF_SLUG"
# echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
# fi
# - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
# - docker push "$CI_REGISTRY_IMAGE${tag}"
# # Run this job in a branch where a Dockerfile exists
# rules:
# - if: $CI_COMMIT_BRANCH
# exists:
# - Dockerfile
build:prereleases: build:prereleases:
stage: dind-build stage: dind-build
tags: tags:
- big-build - big-build
script: script:
- export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-') - export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | sed 's|/|-|g')
- docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" . - docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
only: only:
- branches - branches
except: except:
@@ -54,51 +23,10 @@ build:releases:
tags: tags:
- big-build - big-build
script: script:
- export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-') - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" .
- docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" . - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG" - docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
- docker tag "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG" "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest" - docker push "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest"
only: only:
- tags - tags
# image: fedora:latest
# variables:
# SOMETHING: else
# stages:
# - build
# # - deploy
# services:
# - docker:dind
# before_script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# build:prereleases:
# stage: build
# script:
# - export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-')
# - docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" .
# - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG"
# only:
# - branches
# except:
# - main
# build:releases:
# stage: build
# script:
# - export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-')
# - docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" .
# - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG"
# - docker tag "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG" "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest"
# - docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest"
# only:
# - tags
# # trigger_build:

View File

@@ -1,3 +1,7 @@
FROM quay.io/podman/stable:latest FROM quay.io/podman/stable:latest
RUN dnf install -y podman-docker buildah skopeo # Adding on the docker alias, docker-compose and other useful stuff
RUN dnf install -y podman-docker buildah skopeo docker-compose
# Remove the Emulate Docker CLI using podman messages
RUN touch /etc/containers/nodocker

View File

@@ -1,2 +1,22 @@
# podman-dind-like # podman-dind-like
A Docker-in-Docker like container using Podman A Docker-in-Docker like container using Podman
## Description
This takes the quay.io/podman/stable image and extends it with some enhancements to make it more docker like
and able to use `docker` as a command as well as includes `docker-compose`.
## Notes
This job runs on a self-hosted gitlab agent with the following in the config.toml so this is also compatible with
other self-hosted agents for other CI/CD self-hosted agents
```
[runners.docker]
host = "unix:///run/podman/podman.sock"
tls_verify = false
image = "quay.io/podman/stable"
privileged = true
network_mode = "host"
```