Public Repository

Last pushed: 2 months ago
Short Description
Short description is empty for this repo.
Full Description

gitlab-ci-docker

GitLab CI Docker Service with build tools for Git, DockerHub & AWS ECR. Publish to multiple Docker registries at the same time

Registry Public Path
hub.docker.com Y bcgdv/gitlab-ci-docker
gitlab.com N bcgdv/gitlab-ci-docker
gitlab.bcgdv.io N dev-ops/gitlab-ci-docker

Environment Variables

Parameter Type Description
AWS_BUILD_ACCESS_KEY str AWS ECR ACCESS_KEY
AWS_BUILD_SECRET_KEY str AWS ECR BUILD_SECRET
AWS_BUILD_REGION str AWS ECR Region ( default: us-west-2 )

Usage

## gitlab-ci.yml

stage:
  - build

build:
  image: bcgdv/gitlab-ci-docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
    - sh aws-ecr-login
  script:
    - docker build -t $IMAGE_TAG .
    - docker tag $IMAGE_TAG $DOCKER_TAG
    - docker tag $IMAGE_TAG $ECR_TAG
    - docker push $IMAGE_TAG
    - docker push $DOCKER_TAG
    - docker push $ECR_TAG
Docker Pull Command
Owner
bcgdv

Comments (0)