How to create docker image and publish in gitlab registry
- First create a dockerfile, using the below reference
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