Skip to content

Instantly share code, notes, and snippets.

@cirpo

cirpo/docker.md

Forked from davidino/docker.md
Last active Aug 29, 2015
Embed
What would you like to do?

In this way i can run command directly in the vm

vm fig run
vm docker ps -a

vm will change the virtual machine directory accordling to my local ( mac ) directory

In that way you can expose the docker service outside from the Virtual machine.

# /lib/systemd/system/docker.service
ExecStart=/usr/bin/docker -d -H tcp://0.0.0.0:2375 -H fd://

then

systemctl daemon-reload && sudo service docker restart

So assuming that your vm ip is : 172.16.210.130

export DOCKER_HOST=tcp://172.16.210.130:2375

You will be able to use you local docker command.

#!/bin/bash
locale="\/Users\/davidino"
remote="\/home\/obaley/"
cdir=`echo $(pwd) | sed "s/${locale}/${remote}"`
ssh -t in "cd $cdir; $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.