Code Monkey home page Code Monkey logo

docker-machine-centos7's Introduction

Docker Machine Centos

What is the problem?

Connecting a docker-machine to a vagrant box running centos is not well documented.

Like me have you asked the question:

  • How do I control version of docker on a docker-machine?
  • How do I control version of docker on Boot2docker?

What does it do?

  • Install vagrant plugin: vagrant-vbguest
    • To have vagrant use folder synced from host
  • Vagrant up
    • Install docker and docker-compose version you select
  • Update ssh known_hosts
  • Create docker-machine 'generic' connecting to Vagrant machine running Centos
    • using engine-install-url="" to not override version of docker installed during vagrant up

Set Up

Install docker-machine

curl -L https://github.com/docker/machine/releases/download/v0.7.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
chmod +x /usr/local/bin/docker-machine

Run script

git clone [email protected]:pabvenegas/docker-machine-centos.git
cd docker-machine-centos

# 1. Adjust variables in file ./init.sh
#    ## set up variables - start

# 2. Adjust variables in file /scripts/init.sh
#    To control docker and docker-compose versions
#    to be installed.

# 3. Run init.sh
./init.sh

Post Set Up

# 1. Enable ssh agent forwarding
vi ~/.ssh/config

Host 192.168.99.201
  User vagrant
  Forwardagent yes
  ServerAliveInterval 60
  StrictHostKeyChecking no
  IdentityFile ~/path-to-repo/docker-machine-centos/.vagrant/machines/docker_dev/virtualbox/private_key
  GSSAPIAuthentication no
  IdentitiesOnly yes

# 2. From Mac host
# connect via normal ssh
# NOT docker-machine ssh or vagrant ssh
ssh 192.168.99.201
ssh -i .vagrant/machines/docker_dev/virtualbox/private_key [email protected]

ssh-add -l
# output showing forwarded ssh keys

sudo -i

# https://docs.docker.com/engine/admin/systemd/
> ls -l /etc/docker/
> systemctl show --property=FragmentPath docker
> cat /etc/systemd/system/docker.service

Known errors

Vagrant 1.8.5 bug with Centos 7 ssh

Error during vagrant up: "default: Warning: Authentication failure. Retrying..."

docker-machine-centos7's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.