Body: <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>
  
Comments: CC BY-SA 4.0
Comments: 2019-12-20T10:48:50.923Z
Comments: Could you add some logging of bitbucket-pipelines that contains the errors?
Comments: 030
Comments: CC BY-SA 4.0
Comments: 2019-12-20T13:42:13.117Z
Comments: @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/
Comments: mpdonadio
Comments: CC BY-SA 4.0
Comments: 2019-12-20T13:46:57.257Z
Comments: You should get some error logging in the log of bitbucket-pipeline? I assume that you tried something in the pipeline?
Comments: 030
Tags: <docker><bitbucket-pipelines>
Title: Can you use docker-machine from Bitbucket Pipelines?
UserDisplayName: mpdonadio
ThreadText: # 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
  
  