how to create docker container on tag creation using gitlab ci
Shell
image: docker:19.03.11
services:
- docker:19.03.11-dind
stages:
- build
- test
- release
- deploy
variables:
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build:
stage: build
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
test1:
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /script/to/run/tests
test2:
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /script/to/run/another/test
release-image:
stage: release
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
deploy:
stage: deploy
script:
- ./deploy.sh
only:
- master
build:
image: docker:19.03.11
stage: build
services:
- docker:19.03.11-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
Also in Shell:
- Title
- copy folder from s3 to local
- Category
- Shell
- Title
- install node js ubuntu
- Category
- Shell
- Title
- installing react router dom with yarn
- Category
- Shell
- Title
- ngb-tabset install
- Category
- Shell
- Title
- scp download file
- Category
- Shell
- Title
- install skimage
- Category
- Shell
- Title
- how to tar linux
- Category
- Shell
- Title
- avalible ios simulators
- Category
- Shell
- Title
- free port in linux
- Category
- Shell
- Title
- count files in directory linux
- Category
- Shell
- Title
- how to move file in directory in linux
- Category
- Shell
- Title
- git push all branches
- Category
- Shell
- Title
- git pull onbly submodule
- Category
- Shell
- Title
- how to make a .sh file executable
- Category
- Shell
- Title
- start mongodb
- Category
- Shell
- Title
- how to get out of git og
- Category
- Shell
- Title
- cmd for loop
- Category
- Shell
- Title
- update google chrome command ubuntu
- Category
- Shell
- Title
- bash grep and sort
- Category
- Shell
- Title
- list number of files in each folder linux
- Category
- Shell
- Title
- jscore
- Category
- Shell
- Title
- how to get divided number in mac terminal
- Category
- Shell
- Title
- sh declare variable
- Category
- Shell
- Title
- install vuex
- Category
- Shell
- Title
- improve ubuntu 16.04 performance
- Category
- Shell
- Title
- show applications shortcut ubuntu
- Category
- Shell
- Title
- how to turn off bluetooth in ubuntu 18.04 terminal
- Category
- Shell
- Title
- git delete tag name
- Category
- Shell
- Title
- install homebrew on mac
- Category
- Shell
- Title
- whats up with docker compose and orphan containers
- Category
- Shell
- Title
- install bootstrap 4 npm
- Category
- Shell
- Title
- how to install gulp
- Category
- Shell
- Title
- xcode clean derived data command line
- Category
- Shell
- Title
- silent install google chrome powershell
- Category
- Shell
- Title
- which user apache runs as ubntu
- Category
- Shell
- Title
- homestead.yaml adding provisions
- Category
- Shell
- Title
- linux os upgrade
- Category
- Shell
- Title
- get github profile image
- Category
- Shell
- Title
- how to change directory linux
- Category
- Shell
- Title
- ubuntu 16.04 bluetooth not detecting devices
- Category
- Shell
- Title
- get full path of files in directory linux command
- Category
- Shell
- Title
- kubectl without sudo
- Category
- Shell
- Title
- install bootstrap in laravel
- Category
- Shell
- Title
- cordova ios emulators
- Category
- Shell
- Title
- install deno
- Category
- Shell
- Title
- how to add font icon in gatsby
- Category
- Shell
- Title
- ubuntu install apache2
- Category
- Shell
- Title
- how to make your own linux distro
- Category
- Shell
- Title
- list all services using systemctl
- Category
- Shell
- Title
- minikube without sudo
- Category
- Shell
- Title
- bash display items in array
- Category
- Shell
- Title
- add-apt-repository
- Category
- Shell
- Title
- git commands
- Category
- Shell
- Title
- install nuxt
- Category
- Shell
- Title
- how to disconnect local repo from remote master
- Category
- Shell
- Title
- powershell.exe location
- Category
- Shell
- Title
- stop elasticsearch node
- Category
- Shell
- Title
- gatsby starter hello world
- Category
- Shell
- Title
- install bully kali
- Category
- Shell
- Title
- ubuntu fractional scaling
- Category
- Shell
- Title
- install nginx on ubuntu 18.04
- Category
- Shell
- Title
- sublime text linux
- Category
- Shell
- Title
- docker compose installation
- Category
- Shell
- Title
- shell loop terminating after command
- Category
- Shell
- Title
- installing pip in ubuntu
- Category
- Shell
- Title
- change git commit message
- Category
- Shell
- Title
- unable to install deno in ubuntu
- Category
- Shell
- Title
- create cat document ubuntu
- Category
- Shell
- Title
- docker run command on container
- Category
- Shell
- Title
- grep regex not
- Category
- Shell
- Title
- libpng12.so.0 ubuntu 18.04
- Category
- Shell
- Title
- install tmux ubuntu
- Category
- Shell
- Title
- git cancel last commit
- Category
- Shell
- Title
- linux rename
- Category
- Shell
- Title
- ubuntu install git
- Category
- Shell
- Title
- git remove remote file keep local
- Category
- Shell
- Title
- source fish config
- Category
- Shell
- Title
- install jake
- Category
- Shell
- Title
- github compare commits
- Category
- Shell
- Title
- remove remote git
- Category
- Shell
- Title
- linux red hat version
- Category
- Shell
- Title
- desktop trigger click bash shell ubuntu
- Category
- Shell
- Title
- change user linuxcommand ch
- Category
- Shell
- Title
- linux check ubuntu version
- Category
- Shell
- Title
- why all git pull create merge commit
- Category
- Shell
- Title
- loop through directories bash
- Category
- Shell
- Title
- git remove all pdf files
- Category
- Shell
- Title
- git merge local branch
- Category
- Shell
- Title
- remove mongo lock file from centos 7
- Category
- Shell
- Title
- ssh usage copy file
- Category
- Shell
- Title
- how to connect to the database as root user in linux
- Category
- Shell
- Title
- get additional parameters linux scripting
- Category
- Shell
- Title
- material ui install
- Category
- Shell
- Title
- how to rename a file in ubuntu using terminal
- Category
- Shell
- Title
- how to install software in ubuntu
- Category
- Shell
- Title
- react-devtools agent got no connection
- Category
- Shell
- Title
- check changes after git pull
- Category
- Shell
- Title
- find and replace in all files in directory centos
- Category
- Shell
- Title
- gatsby-plugin-react-helmet npm
- Category
- Shell
- Title
- zip current directory mac command line
- Category
- Shell