Tag: docker machine

Docker run script in host on docker-compose up

thank you for watching this question. So my question relates to best practices on how to run a script on a docker-compose up directive. Currently i’m sharing a volume between host and container to allow for the script changes to be visible to both host and container. Similar to a watching script polling for changes […]

set docker-machine variables using a bash script

I have a script like so: #!/usr/bin/env bash eval $(docker-machine env default) The goal is to automate the setting of variables like export DOCKER_TLS_VERIFY export DOCKER_HOST export DOCKER_CERT_PATH export DOCKER_MACHINE_NAME But when I check afterwards, the variables are not set. This is not the case if I run each export command manually. What am I […]

Access host docker-machine from within container

I have an image that I’m using to run my CI/CD builds (using GitLab CE). I’d like to deploy my app doing something like this from within the container: eval “$(docker-machine env manager)” sudo docker stack deploy –compose-file docker-stack.yml web However, I’d like the docker-machine to access machines defined on the host system since the […]

How can I use the docker daemon from a container running on a host provisioned by Docker Machine?

I am trying to use the docker daemon from a container on a host created by docker machine. Initially I was trying to connect to the host daemon via a volume-mounted unix socket (-v /var/run/docker.sock:/var/run/docker.sock), but that kept failing: [root@f57377672f7f docker]# env | grep DOCKER DOCKER_HOST=unix:///var/run/docker.sock DOCKER_TLS_VERIFY=1 DOCKER_CERT_PATH=/etc/docker [root@bd4154b372d5 code]# docker images An error occurred […]

docker-machine – connection refused error

I’m using docker-machine, docker-compose on mac OS to start up my container. In my docker-compose.yml, i have ports: – “8080:8080” expose: – “3000” – “8000” – “8080” Steps to create docker-machine docker-machine create testdocker –driver=virtualbox eval “$(docker-machine env testdocker)” docker-compose up -d (all containers start up properly) docker-machine ip localdocker open echo ${DOCKER_HOST_IP} […]

Can't install docker – Permission denied?

I’m trying to install docker-machine following the guide. $ curl -L https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \ > chmod +x /usr/local/bin/docker-machine Error: bash: /usr/local/bin/docker-machine: Permission denied Why? How can resolve this? I’m on Xubuntu 16.04.

Docker machine / Docker link returns different container IP on Digital Ocean

I created a Droplet on DigitalOcean using Docker machine. When running two containers and linking them this way from Jenkins: /bin/bash/eval “$(docker-machine env deployment)” /bin/bash -c “docker run -d -t –name container1 -p 5000:5000 image1” /bin/bash -c “docker run -d -t –name container2 -p 5001:5001 –link container1:container1 image2” And then docker inspect container1 | grep […]

How to persist changes to boot2docker in docker-machine?

I am using docker-machine which I use to manage VM running boot2docker with virtualbox as driver. I need to mount directory to this VM. I was able to do that by adding the folder to shared folders list in settings of VM in Virtualbox Manager. Then using sudo mount -t vboxsf -o uid=1000,gid=50 <name of […]

Nodemon doesn't restart

I have a nodemon running in a docker-container with a mounted volume on OSX. Nodemon is receiving the file-change but it doesn’t restart the server. Output: Creating piclet_web_1… Attaching to piclet_web_1 web_1 | 7 Sep 13:37:19 – [nodemon] v1.4.1 web_1 | 7 Sep 13:37:19 – [nodemon] to restart at any time, enter `rs` web_1 | […]

Requests to docker-machine created boot2docker host

For fast development purposed I spin a MongoDB container on boot2docker on the standard MongoDB port and then I just connect to the database on the boot2docker ip on that port. Currently its With docker-machine I created a new boot2dockers named “host” which has the ip where I installed docker-compose to spin MongoDB […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.