<p>I have some servers where I have nginx installed on the base system in reverse proxy mode, and then use Docker deployments to push out containers where just the local HTTP port is exposed.</p>

<p>We don't have a full CI/CD system in place, and have been getting along fine with Bitbucket Pipelines for many things (usually just doing rsync of build artifacts).</p>

<p>In my Docker based projects, my release script that I run locally ends with something along the lines of</p>

<pre><code>eval $(docker-machine env ${MACHINE_NAME})
docker stop ${IMAGE_NAME}-app-1
docker pull ${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}
docker run -d -p 8080:8080 --rm --name ${IMAGE_NAME}-app-1 ${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}
</code></pre>

<p>This works great, but I would like to run this from a pipeline as a deployment step.  Given that certificates and keys are stored in <code>~/.docker/machine/</code>, is this even possible, or do I need to do a server side script that I trigger with ssh from the pipeline?</p>

CC BY-SA 4.0
2019-12-20T10:48:50.923Z
Could you add some logging of bitbucket-pipelines that contains the errors?
030
CC BY-SA 4.0
2019-12-20T13:42:13.117Z
@030 It's not really a problem of getting errors, it's that i don't know how to do this. The info in `~/.docker/machine/` is private, so it shouldn't be part of the repo to be available to the pipeline/
mpdonadio
CC BY-SA 4.0
2019-12-20T13:46:57.257Z
You should get some error logging in the log of bitbucket-pipeline? I assume that you tried something in the pipeline?
030
<docker><bitbucket-pipelines>
Can you use docker-machine from Bitbucket Pipelines?
mpdonadio
# Can you use docker-machine from Bitbucket Pipelines?

(Asked by: username_0 on 2019-10-18)

I have some servers where I have nginx installed on the base system in reverse proxy mode, and then use Docker deployments to push out containers where just the local HTTP port is exposed.
We don't have a full CI/CD system in place, and have been getting along fine with Bitbucket Pipelines for many things (usually just doing rsync of build artifacts).
In my Docker based projects, my release script that I run locally ends with something along the lines of
eval $(docker-machine env ${MACHINE_NAME})
docker stop ${IMAGE_NAME}-app-1
docker pull ${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}
docker run -d -p 8080:8080 --rm --name ${IMAGE_NAME}-app-1 ${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}

This works great, but I would like to run this from a pipeline as a deployment step.  Given that certificates and keys are stored in ~/.docker/machine/, is this even possible, or do I need to do a server side script that I trigger with ssh from the pipeline?

**Tags:** docker, bitbucket-pipelines

> **Comments:**
> **username_1**: Could you add some logging of bitbucket-pipelines that contains the errors?  
> **username_0**: @username_1 It's not really a problem of getting errors, it's that i don't know how to do this. The info in `~/.docker/machine/` is private, so it shouldn't be part of the repo to be available to the pipeline/  
> **username_1**: You should get some error logging in the log of bitbucket-pipeline? I assume that you tried something in the pipeline?  

---

## 0 answers

