To update some images I used 'docker-compose pull'. Then I build: 'docker-compose build'.
I wanted only to update the Application Container so I removed it and restarted: 'docker-compose rm app' and 'docker-compose up -d app'.
But something unwanted happened. The data container was recreated too. The old data is lost.
Dockerfile for Datacontainer:
FROM gitlab/gitlab-ce:latest
VOLUME ["/etc/gitlab", "/var/log/gitlab", "/var/opt/gitlab"]
ENTRYPOINT ["hostname"]
docker-compose.yml:
version: '2'
services:
gitlab:
image: 'gitlab/gitlab-ce:latest'
domainname: example.com
hostname: gitlab
networks:
- devenv
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.example.com'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
ports:
- '80:80'
- '2224:22'
volumes_from:
- gitlabdata
gitlabdata:
build: gitlab-data
How can I avoid this next time?