Self-hosting using virtual machines instead of docker images

I’m aware of the GitLab self-hosting repository and I appreciate the work that went into it, especially the documentation. I have started going through the steps to learn what components make up the self-hosting solution. I see a couple of docker images being pulled in from an /e/ internal docker store, e.g.: self-hosting Nextcloud image.. How custom are these images? Is there a way to get more information on what was done in terms of customization? I’d like to mimic those steps (via ansible) to provision the corresponding VM on my Ubuntu server.
Many thanks!

Reverse-engineering a Docker customized image is not an easy process, but let’s try! :smiley_cat:

From your link to Docker Compose file, we can go to Files · selfhost-21.0.9.12 · e / infra / ecloud / nextcloud · GitLab.
Here, the most important file is the Dockerfile.

Docker official image for Nextcloud

In the Dockerfile, we have a FROM keyword, with " nextcloud:21.0.9-fpm": as only image name and tag are specified, the source will be https://hub.docker.com/.
In Docker Hub, search for the “nextcloud” image name, then browse the tags to 21.0.9-fpm.
Then, clicking on the tag name will reveal all the layers (the steps to build the image): layers.
After some research we can find: docs/nextcloud at da957504b79cc79fff4d834c1a5d39b35c6bf3db · docker-library/docs · GitHub and repo-info/21.0.9-fpm.md at f7c94c4574d8ee751de0ba7be2cad1fef9b079ed · docker-library/repo-info · GitHub.

/e/ image customization

OK, we got our official source now. But there are some enhancement from /e/ team, just follow the content of: Dockerfile · selfhost-21.0.9.12 · e / infra / ecloud / nextcloud · GitLab.
This doc Compose specification | Docker Documentation may be of help :wink:
One file you may pay attention to is the custom entrypoint: custom_entrypoint.sh · selfhost-21.0.9.12 · e / infra / ecloud / nextcloud · GitLab.

Setup during installation

Last, but not least, the Nextcloud container (instance from image) get some additional setup during installation.
The entry point is: scripts/bootstrap.sh · master · e / infra / ecloud-selfhosting · GitLab.
This is a 2-step process: most values are acquired and stored in scripts/init-repo.sh · master · e / infra / ecloud-selfhosting · GitLab, then the hard work is done in scripts/postinstall.sh · master · e / infra / ecloud-selfhosting · GitLab.
Tips:

  • don’t skip the Salt questionnaire part: it is essential to fill the .env file
  • Nextcloud configuration file template is templates/nextcloud/config.php · master · e / infra / ecloud-selfhosting · GitLab
  • docker exec commands can interact with a container, for example we can see some occ configuration commands for Nextcloud
  • “volumes” are, from a very simplistic point of view, shares between the host OS and the container (data are stored on host instead of container)
  • all network stack (IP addresses, internal host names, …) is provided by Docker

As a side note, Ansible configuration of selfhosted is WIP (Work In Progress) by /e/ team, but no ETA for now.

3 Likes

Thanks, @smu44 I’ll take the time to read through your post in detail as it appears that’s exactly what I was looking for in terms of learning more about the containers. I’d like very much to go through each container’s config and mimic it in a VM. Cheers!

1 Like

Happy to be of help :smile_cat:

If you have any further question, I can check on one of my running selfhosted or fire a new one within minutes.