#5 Gitlab Container Registry | Gitlab Registry | Gitlab Tutorial

preview_player
Показать описание
#Gitlab #GitlabContainerRegistry #Dockerfile #techwithfoyzur

You can support me here 🙏

In this video, I will show you how to use the GitLab container registry aka GitLab registry. We are going to use docker in GitLab. GitLab Container Registry is a secure and private registry for Docker images. The GitLab set of tools includes a container registry. It is a hosted registry built with open source tools that are secure and private. It can host OCI-compatible images and provides a fully-featured integration with GitLab. This allows users to manage all their GitLab DevOps tooling in one space. It is available in their free tier.

🈯️Timestamps 🈯️
00:00 Intro
00:38 Write a Dockerfile
05:03 Build the Dockerfile
06:59 Docker run the container
08:05 Docker exec to the container
09:33 How to tag a docker image
10:20 Docker login
11:10 Docker commit
11:48 How to push a docker image
13:39 Gitlab container regsitry

⏩ Dockerfile

FROM ubuntu:16.04
# add metadata
LABEL version="1.0.0"
# to turn off the questions asked for location and timezone
ARG DEBIAN_FRONTEND=noninteractive
# update repository and install apache2 web server
RUN apt-get update -y && \
apt-get install apache2 apache2-utils curl -y && \
apt-get clean
# expose on port 80
EXPOSE 80
# start the apache service as soon as container is created
CMD ["apachectl","-D","FOREGROUND"]

Steps:

1. Write a simple Dockerfile.We will write a simple Dockerfile for the apache webserver
let's create a simple HTML file -
⏩ docker build -t="apache_webserver" -f Dockerfile .
⏩ docker images`

2. Run a docker container from that image
⏩ docker run -d -p 80:80 apache_webserver`
⏩ docker ps
⏩ docker exec -it 89203f2139e0 bash
⏩ service apache2 status

3. Let's push this image to GitLab registry
⏩ docker ps

▶️ Useful links:
*️⃣ Dockerfile
*️⃣ Docker Build
*️⃣ Docker commit
*️⃣ Docker tag
*️⃣ Docker push
*️⃣ Gitlab Container Registry
*️⃣ HTML
Рекомендации по теме
Комментарии
Автор

Hi, in Gitlab i have one stage Deploy i want to build login and push to ACR. how can we tag the latest image everytime i build an image it shld be get it a latest. can u tel me the command.

raghur
Автор

is it possible to docker login, push. pull to self managed gitlab container registry from a local machine? gitlab is hosted on kubernetes

jovelynobias