Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finalize docker-compose.yml for v2 #661

Closed
wants to merge 6 commits into from
Closed

finalize docker-compose.yml for v2 #661

wants to merge 6 commits into from

Conversation

sameersbn
Copy link
Owner

No description provided.

@sameersbn sameersbn mentioned this pull request Apr 9, 2016
@sameersbn
Copy link
Owner Author

Ideally I would have liked to use a volumes section to define named volumes. but unfortunately the local volume driver does not allow specifying a host path for the volume.

I have also applied the :Z volume label, but haven't tested it on a selinux based distro like redhat or centos. It would be great if someone could test this.

@solidnerd
Copy link
Collaborator

This would possible if you use a volume plugin like local-persist

@sameersbn
Copy link
Owner Author

Thanks for linking to local-persist. Good to know 😄
For the sample docker-compose.yml file we need to stick with what docker provides as the default.

@solidnerd
Copy link
Collaborator

@sameersbn. I put my test results in here as you mentioned me in #658 . I guess it will provide a litte bit more clarity.
First of all everything is working for me now. Thanks for the work. But i got some barriers.

  1. If you don't have the latest redis image you get an error message that the command does not work.
    To fix it. You to pull the latest redis image.
  2. Maintenance has been changed. The way of restoring a backup is different to the old way, because your gitlab container must be in the same network and you should provide the enviroment variables to ensure that the gitlab_container finds the database.
    To fix it i use the following command:
docker run --name gitlab -it --rm --net="gitlab_gitlab_backend" -v /srv/gitlab/gitlab:/home/git/data --env-file=gitlab.env sameersbn/gitlab:8.6.4 app:rake gitlab:backup:restore BACKUP=1460347212

I used the env variables from the compose file. In that case we sould use env_file to define them once. Lets rethink about #600.

@sameersbn
Copy link
Owner Author

If you don't have the latest redis image you get an error message that the command does not work. To fix it. You to pull the latest redis image.

I guess the redis client version in the gitlab image may not be compatible.

Maintenance has been changed. The way of restoring a backup is different to the old way, because your gitlab container must be in the same network and you should provide the enviroment variables to ensure that the gitlab_container finds the database. To fix it i use the following command:

Wouldn't you use docker-compose to launch the rake task?

create a backup

docker-compose run --rm gitlab app:rake gitlab:backup:create

restore a backup

docker-compose run --rm gitlab app:rake gitlab:backup:restore BACKUP=1460905799

Lets rethink about #600.

I have commented on the issue #600 (comment)

@solidnerd
Copy link
Collaborator

solidnerd commented Apr 17, 2016

I mean sameersbn/redis:latest image. I needed to pull that than everything works at docker-compose up.

Next time i will try to use docker-compose to run the rake tasks. It will make my work a lot of easier. 😅

@sameersbn
Copy link
Owner Author

I mean sameersbn/redis:latest image. I needed to pull that than everything works at docker-compose up.

Yes. I meant the redis-cli version in the gitlab image was probably not compatible with the redis-server from sameersbn/redis:latest

Next time i will try to use docker-compose to run the rake tasks. It will make my work a lot of easier. 😅

With docker-compose v2 I think this might be the only valid way of doing things correctly because of all the networking bits.

environment:
version: '2'

networks:
Copy link
Collaborator

@solidnerd solidnerd Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The networks key isn't needed because docker-compose will create an own network by default. So this could be remove @sameersbn.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, its not "required".
Not sure if we should keep it or remove it. Guess we can remove it for now and add it later as we see fit?

@jgsqware
Copy link

Hello, any idea when you will merge it?

@sameersbn
Copy link
Owner Author

@jgsqware can you try it out and let us know it works for you? will merge it on the weekend after doing some tests to check if backup/restore operations work without issues.

sameersbn pushed a commit that referenced this pull request May 20, 2016
@sameersbn sameersbn closed this May 20, 2016
@sameersbn sameersbn deleted the compose-v2 branch May 20, 2016 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants