Docker Image With Docker Installed

Posted onby

Gitea provides automatically updated Docker images within its Docker Hub organization. It ispossible to always use the latest stable tag or to use another service that handles updatingDocker images.

  1. Reference
  2. Ubuntu Docker Image With Docker Installed
  3. › Docker-in-docker-521958d34efdDocker In Docker?. Can You Run Docker Inside A Docker… By ...

Install Nginx In Docker Container Linux Shipping Our Image. Now let’s share our images on Docker so others on our team can pull the images and run them locally. This is also a great way to share your application with others outside of your team such as testers and business owners. To push your images to Docker’s repository run the docker.

  1. The Grafana Image Renderer plugin does not currently work if it is installed in a Grafana Docker image. You can build a custom Docker image by using the GFINSTALLIMAGERENDERERPLUGIN build argument.
  2. Note: The CircleCI convenience images for the Docker executor come with the Docker CLI pre-installed. If you are using a third-party image for your primary container that doesn’t already have the Docker CLI installed, then you will need to install it as part of your job before calling any docker commands.
  3. The Grafana Image Renderer plugin does not currently work if it is installed in a Grafana Docker image. You can build a custom Docker image by using the GFINSTALLIMAGERENDERERPLUGIN build argument.

The rootless image use Gitea internal ssh to provide git protocol and doesn’t support openssh.

This reference setup guides users through the setup based on docker-compose, but the installationof docker-compose is out of scope of this documentation. To install docker-compose itself, followthe official install instructions.


The most simple setup just creates a volume and a network and starts the gitea/gitea:latest-rootlessimage as a service. Since there is no database available, one can be initialized using SQLite3.Create a directory for data and config then paste the following content into a file named docker-compose.yml.Note that the volume should be owned by the user/group with the UID/GID specified in the config file. By default Gitea in docker will use uid:1000 gid:1000. If needed you can set ownership on those folders with the command: sudo chown 1000:1000 config/ data/If you don’t give the volume correct permissions, the container may not start.For a stable release you could use :latest-rootless, :1-rootless or specify a certain release like :1.15.3-rootless, but if you’d like to use the latest development version then :dev-rootless would be an appropriate tag.

Custom port

To bind the integrated ssh and the webserver on a different port, adjustthe port section. It’s common to just change the host port and keep the ports withinthe container like they are.

MySQL database

To start Gitea in combination with a MySQL database, apply these changes to thedocker-compose.yml file created above.

PostgreSQL database

To start Gitea in combination with a PostgreSQL database, apply these changes tothe docker-compose.yml file created above.


Named volumes

To use named volumes instead of host volumes, define and use the named volumewithin the docker-compose.yml configuration. This change will automaticallycreate the required volume. You don’t need to worry about permissions withnamed volumes; Docker will deal with that automatically.

MySQL or PostgreSQL containers will need to be created separately.

Custom user

You can choose to use a custom user (following –user flag definition an example to clone the host user git definition use the command id -u git and add it to docker-compose.yml file:Please make sure that the mounted folders are writable by the user.


To start this setup based on docker-compose, execute docker-compose up -d,to launch Gitea in the background. Using docker-compose ps will show if Giteastarted properly. Logs can be viewed with docker-compose logs.

To shut down the setup, execute docker-compose down. This will stopand kill the containers. The volumes will still exist.

Notice: if using a non-3000 port on http, change app.ini to matchLOCAL_ROOT_URL = http://localhost:3000/.


After starting the Docker setup via docker-compose, Gitea should be available using afavorite browser to finalize the installation. Visit http://server-ip:3000 and follow theinstallation wizard. If the database was started with the docker-compose setup asdocumented above, please note that db must be used as the database hostname.


Customization files described here shouldbe placed in /var/lib/gitea/custom directory. If using host volumes, it’s quite easy to access thesefiles; for named volumes, this is done through another container or by direct access at/var/lib/docker/volumes/gitea_gitea/_/var_lib_gitea. The configuration file will be saved at/etc/gitea/app.ini after the installation.


❗❗ Make sure you have volumed data to somewhere outside Docker container ❗❗


To upgrade your installation to the latest release:

  • Backup your setup
  • Change volume mountpoint from /data to /var/lib/gitea
  • If you used a custom app.ini move it to a new volume mounted to /etc/gitea
  • Rename folder (inside volume) gitea to custom
  • Edit app.ini if needed
    • Set START_SSH_SERVER = true
  • Use image gitea/gitea:1.15.3-rootless

Managing Deployments With Environment Variables

In addition to the environment variables above, any settings in app.ini can be set or overridden with an environment variable of the form: GITEA__SECTION_NAME__KEY_NAME. These settings are applied each time the docker container starts. Full information here.

These environment variables can be passed to the docker container in docker-compose.yml. The following example will enable an smtp mail server if the required env variables GITEA__mailer__FROM, GITEA__mailer__HOST, GITEA__mailer__PASSWD are set on the host or in a .env file in the same directory as docker-compose.yml:

To set required TOKEN and SECRET values, consider using gitea’s built-in generate utility functions.

Ubuntu Docker Image With Docker Installed

This should be possible by forcing authorized_keys generation via gitea admin regenerate keys. › Docker-in-docker-521958d34efdDocker In Docker?. Can You Run Docker Inside A Docker… By ...

We should use directly SSH AuthorizedKeysCommand when it will be based on internal api.