We are using gitlab as git software now for CI i choose gitlab and decide to not use any thing else
so i have a question
my runner use docker as executor so I decide to have 3 stages
-build
-test
-deploy
the question is can i use exactly the same image in build in test stage or a way to push that image in our private registery and call it in test section ?
The question is each stages built a docker image :
Build
Test
Deploy
in first stage we use a public docker image execute several commands in it and then exit is it true ?
I dont want to exit the container I want to save that and using it as Test stage image .
Now im using SSH as executor and use a Docker file to build an image and do other works .
its not all about creating a Docker inside a Docker container we want to call Docker docker inside the container Commit changes and push it to our private registry
I’m starting to work on something similar to this too.
What I’m thinking is that you will only run the “docker build” command in the first build stage for your “dev” environment. As you promote the code via Merge Request to each new environment “Integration” or “QA” or “Staging” or “Production”, you can just simply re-tag the same docker image in the private Gitlab Registry with the relevant tag names for the environment you are targeting.
You will use the “docker tag” command to do that.
So at the end of your deploy stage, you can try to run that “docker tag” command. In the subsequent stages you won’t re-build the Docker Image, but just pull against the image you just tagged.