Skip to content

Instantly share code, notes, and snippets.

@danrue
Last active January 13, 2021 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danrue/49345b32c7a1f9d0a8cb3e126a01e1b1 to your computer and use it in GitHub Desktop.
Save danrue/49345b32c7a1f9d0a8cb3e126a01e1b1 to your computer and use it in GitHub Desktop.
gitlab-ci for building and then using a container using podman
stages:
- build-image
- mirror
before_script:
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- podman pull $IMAGE_TAG || true # ensure the latest is downloaded
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
build-image:
image: quay.io/podman/stable
stage: build-image
script:
- podman build --cache-from $IMAGE_TAG --pull -t $IMAGE_TAG .
- podman push $IMAGE_TAG
mirror-nightly:
image: $IMAGE_TAG
stage: mirror
script:
- echo "hello, world!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment