How to fix possibly wrong Windows Docker setup (no volumes set up)

Hi, first of all, I’m a noob regarding Docker.

My company asked me to setup a standalone GitLab instance on an available Windows server. I decided to install Docker for Windows (WLS 2 is activated) and run the GitLab CE image on that. Everything went fine.

Except that I took a shortcut that I don’t know how to fix. Basically in the installation guide in the volumes location section there are no steps for Windows, so I decided to skip it. Then I removed the volume options from the run command:

docker run --detach \
  --hostname \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \

Everything works and the company is happy, except that I have no idea where the data is saved. I suppose it defaults inside the Docker, which I just learned is a wrong thing to do.

I discovered my mistake by trying to understand how to update my installation to the latest version, which requires to delete the Docker instance, which didn’t make sense to, since it would possibly delete all the data.

How can I fix this?

Hi @lolivieri

Use docker cp | Docker Documentation
To copy data from you existing GitLab container into the Docker host filesystem and use host mount

docker container stop gitlab
docker container cp gitlab:/etc/gitlab path_on_your_host_for_etc
docker container cp gitlab:/var/log/gitlab path_on_your_host_for_logs
docker container cp gitlab:/var/opt/gitlab path_on_your_host_for_data

you can then host mount directories into new containers:
docker container run -d -v path_on_your_host_for_etc:/etc/gitlab -v path_on_your_host_for_logs:/var/log/gitlab -v path_on_your_host_for_data:/var/opt/gitlab ....