docker-gitlab icon indicating copy to clipboard operation
docker-gitlab copied to clipboard

where can i find gitlab-ctl ?

Open lgersman opened this issue 10 years ago • 7 comments

Hello,

i actually want to import repositories from another gitlab instance into my docker-gitlab instance.

As far as i read i have to do a bunch of "gitlab-ctl" calls (http://stackoverflow.com/questions/19902417/change-the-data-directory-gitlab-to-store-repos-elsewhere) but I cannot find gitlab-ctl in the docker container.

Do I have to install it additionally ?

Kind regards,

Lars

lgersman avatar Feb 05 '16 13:02 lgersman

This image is built from GitLab sources. gitlab-ctl is part of the the omnibus packages and as such is not available in here.

On Friday 05 February 2016 06:33 PM, lgersman wrote:

Hello,

i actually want to import repositories from another gitlab instance into my docker-gitlab instance

As far as i read i have to do a bunch of "gitlab-ctl" calls (http://stackoverflowcom/questions/19902417/change-the-data-directory-gitlab-to-store-repos-elsewhere) but I cannot find gitlab-ctl in the docker container

Do I have to install it additionally ?

Kind regards,

Lars

— Reply to this email directly or view it on GitHub https://github.com/sameersbn/docker-gitlab/issues/595.

Sameer Naik

w: http://www.damagehead.com e: [email protected]

sameersbn avatar Feb 05 '16 18:02 sameersbn

Hi @lgersman

Had the same problem a while back. There are actually many ways to import repositories.

  1. Import by the web interface (one by one) from many 3rd parties hosting repo.
  2. Import by file system (batch import of many repositories) <= I guess this is what you are looking for ?
  3. Sync repo (mirroring is available in EE version only but you can manage it with scripts, although it would be wise to really know git internals before going on such a journey).

Assuming that you want to batch-import many repos. The fatest and simplest way is to copy the bare repos to the gitlab volume. I'll explained, the default config of the docker-compose.yml places GitLab repos in /srv/docker/gitlab/gitlab/repositories on the host, they are in /home/git/data inside the container. Copy all those bare repos (by rsync or scp, rsync is faster) to that folder on the host. Before you run the next command, make sure the DB container (postgres by default) and the redis container are running Then you need to import them into GitLab by running a rake command

docker run --name gitlab -it --rm \
    --link redis:NAME_OF_REDIS_CONTAINER \
    --link postgresql:NAME_OF_POSTGRES_CONTAINER \
    --e "GITLAB_SECRETS_DB_KEY_BASE=dslkjfskjdfwlekjflskdjflskdjfalskdhflaksdjagjdl"
    -v "/srv/docker/gitlab/gitlab:/home/git/data"
    [OTHER OPTIONS] \
    sameersbn/gitlab:8.4.3 app:rake gitlab:import:repos

Watch the logs and your repos should be available into your new gitlab container.

Any command you want to try you can do with rake, I am not sure but for me I never needed more. See https://github.com/sameersbn/docker-gitlab#rake-tasks

veggiemonk avatar Feb 05 '16 18:02 veggiemonk

whoops! I didn't even realize @lgersman was trying to import repos :stuck_out_tongue: information provided by @veggiemonk is spot on.

sameersbn avatar Feb 05 '16 18:02 sameersbn

@sameersbn a quick PR is coming. Many people got stuck at this first step. (sigh) legacy... ;-)

veggiemonk avatar Feb 05 '16 18:02 veggiemonk

PR is #597

veggiemonk avatar Feb 05 '16 18:02 veggiemonk

Great support - thank you both !!! On Feb 5, 2016 7:38 PM, "Julien Bisconti" [email protected] wrote:

PR is #597 https://github.com/sameersbn/docker-gitlab/pull/597

— Reply to this email directly or view it on GitHub https://github.com/sameersbn/docker-gitlab/issues/595#issuecomment-180491936 .

lgersman avatar Feb 05 '16 20:02 lgersman

if you're looking for gitlab-ctl or gitlab-rails in order to reset your root password (like i was), try ( https://github.com/sameersbn/docker-gitlab/issues/916#issuecomment-395078678 ):

  1. docker exec -it GITLAB_CONTAINER_ID /bin/bash
  2. su - git
  3. cd gitlab
  4. bundle exec rails c production
  5. user = User.where(id: 1).first
  6. user.password = 'NEW_PASS'
  7. user.password_confirmation = 'NEW_PASS'
  8. user.save
  9. exit

mhciael avatar Jun 06 '18 14:06 mhciael