How to install Gitlab-CE in CentOS-7 Docker container

I have successfully installed GitLab-CE edition using Docker-Compose file as per below link on my Docker host server.

https://docs.gitlab.com/omnibus/docker/#install-gitlab-using-docker-compose

After the installation I found the Docker Container Operating System is Ubuntu-16.04LTS.

I would like to know is It possible to install GitLab-CE in CentOS-7 Docker container? If yes could you please share the instructions. It would be great helpful.

There are not supposed to be any differences. Docker is Docker.

Hi,

you’ll need to create your own image which is based on CentOS 7 then. This can be used in the docker-compose setup then as different image entry.

Since the Docker image recommended in the docs is officially supported and tested, I would suggest to keep using it, instead of going your own route. There is not much advantage in changing the container image to a different distribution other than a) more work involved b) less community support.

Cheers,
Michael

1 Like

Hi Michael, Okay Thanks for reply. I already have CentOS-7.8 Docker Image. So in order to use this image I need to follow the below steps am I right.

  1. In docker-compose.yml file I need build my Dockerfile with Docker RUN commands( As per the Standard GitLab Installation steps for CentOS-7)?

If possible could you share me the steps. So that I ll take it forward.

Hi,

I don’t have any exact steps on how to build the Docker image. You’ll need to extract these details from the steps how the current Ubuntu image is built and adopt the CLI commands for CentOS then. All of that can be done within a Dockerfile which builds the image.

That’s how I would do it, including quite a few time on Google searches. Still, I don’t quite understand what’s wrong with using the official container with Ubuntu - they are there and maintained with little effort for you.

Cheers,
Michael

Hi Michael,

Okay, thanks for the suggestion to refer the existing Ubuntu image Dockerfile. Further i will explore it. The reason i am looking for CentOS-7 specifically is in our organization, we have security tools and those supports only CentOS. Hence i have raised Q&A here. Thanks a lot for your support.

Hi,

these security tools highly likely need to run an agent as daemon. This is something you should avoid with containers solving the single purpose application. As a side note, container security is a little different to host security. Take notes what exactly these security tools in your company do, and see whether you can still apply them to a running service. If they do port scans for HTTP attacks for instance, tcp/80 and tcp/443 are still available mapped onto the host system.

Cheers,
Michael