Docker Machine is a tool designed to manage Docker Engine setup on local and remote hosts. Docker Machine does all the host deployment work for you: it provisions the host, installs Docker Engine on them, and then configures the Docker client to talk to the Docker Engines.
We now provide a driver for Docker Machine to easily manage all your containers on Scaleway. Docker Machine can now be used to provision all your Docker hosts on our cloud platform!
This blog post shows you how easy it is to create Docker hosts on Scaleway with Docker Machine.
docker-machine will simplify all your Docker deployments.
Let's try to deploy a Docker container on Scaleway using
docker-machine. We will first create a Docker host and then our first container.
1. Install docker-machine with the Scaleway driver
You will first need to install Docker Machine and our Scaleway driver.
If you're running Mac OS X, this can be done with two lines:
brew tap scaleway/scaleway brew install scaleway/scaleway/docker-machine-driver-scaleway
2. Create your Docker host
We will now use
docker-machine to create our first Docker host named scw-docker01 backed by a VC1S.
ACCESS_KEYby your credentials. Checkout how to generate your API token here.
$ docker-machine create -d scaleway --scaleway-token=TOKEN --scaleway-organization=ACCESS_KEY --scaleway-name="scw-docker01" --scaleway-commercial-type "VC1S" scw-docker01 Running pre-create checks... Creating machine... (scw-docker01) Creating SSH key... (scw-docker01) Creating server... (scw-docker01) Starting server... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(upstart)... Installing Docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env scw-docker01
3. Launch our first container
We are ready to launch our first container. We will first load the environment variables to use the Scaleway host.
$ eval $(docker-machine env scw-docker01) # Check that scw-docker01 is activated $ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS scw-docker01 * scaleway Running tcp://188.8.131.52:2376 v1.10.3 dev - virtualbox Running tcp://192.168.99.100:2376 v1.9.1
Let's spawn a ownCloud docker container on our Scaleway Docker host.
$ docker run -d -p 80:80 owncloud:8.1 # starts a owncloud image Unable to find image 'owncloud:8.1' locally 8.1: Pulling from library/owncloud ... # Check that your container has been started $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ebdd86fcd18b owncloud:8.1 "/entrypoint.sh apach" 22 seconds ago Up 20 seconds 0.0.0.0:80->80/tcp elegant_shirley
Et voilà, you can now launch your containers with docker-machine on Scaleway!
If you want to go further with Docker Machine, checkout our examples directory on GitHub, you'll find examples to start Docker Swarm and Rancher clusters. If you don't want to manage your containers from your machine, you can also discover Docker with our Docker Instant-App.
Happy Cloud Riding,