How to create docker image and publish in gitlab registry

2. From the command prompt, you must run the below command.

For the first time, you must need to login into the registry

docker login registry.gitlab.com -u <user> -p <password>

Now build the dockerfile

docker build -t image:latest .

For pushing the image into registry

docker push registry.gitlab.com/registryrepo/image:latest

3. Now if you want to create docker containers from the image, run the below

docker run image:latest

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store