microsoft / VSTS-Docker-Preview

Preview repo for Docker extension
16 stars 8 forks source link

issue with docker-compose task and custom registry #6

Open djeeg opened 8 years ago

djeeg commented 8 years ago

I am trying to use the docker-compose task and have run into a couple of issues

My VSTS config:

Docker Host Connection: custom linux VM in azure (this is working for docker tasks)
Docker Registry Connection: different custom linux VM in azure (this is working for docker tasks)
Docker Compose File: file referenced from VSTS Git
Docker Compose Command: up -d

Output from the task execution when run from a Release:

##[section]Starting: Docker Compose: up -d
5fff5eff-07b7-4763-a23d-XXXX exists true
ec098a78-e518-4224-94ff-XXXX exists true
[command]/usr/bin/docker login -e ***** -u ***** -p *****
Flag --email has been deprecated, will be removed in 1.13.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
Not found docker-compose: null
##[section]Finishing: Docker Compose: up -d

The issues I see are:

djeeg commented 8 years ago

Couldn't get the docker-compose task to work, and have now swapped to a SSH task instead

He's what I did if anyone else has the same problem

Connect to VM via docker-machine and install docker-compose, something like this:

sudo curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s-uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose

Then in VSTS, create a service SSH endpoint to the VM with docker

In Release definition, add two tasks:

sudo docker login -u XXX -p XXX dockerregistry.XXX.com:5000 cd /home/docker-user/release && export COMPOSE_PROJECT_NAME=XXX && export DOCKER_REGISTRY=dockerregistry.XXX.com:5000/ && export COMPOSE_FILE=docker-compose.yml && export COMPOSE_HTTP_TIMEOUT=600 && sudo -E docker-compose down 2>&1 && sudo -E docker-compose pull 2>&1 && sudo -E docker-compose up --build --force-recreate --timeout 600 -d 2>&1

I needed to pipe stderr to stdout to prevent the task from failing

stepro commented 7 years ago

@djeeg, custom/private registries work fine in the latest version of the extension. Feel free to validate and re-open this issue if you are still seeing problems. Thanks!