0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

メモ: Docker on Scaleway

Posted at

対象クライアント mac

前作業

scalewayのアカウントを作成
https://www.scaleway.com/

公開鍵を管理画面から追加
https://cloud.scaleway.com/#/credentials

macに、homebrew をいれる
docker toolbox for macをいれる

brew install scw
scw login

1. scaleway driverからdocker用インスタンス作成

サードパーティ ドライバーをインストール
https://github.com/scaleway/docker-machine-driver-scaleway

brew install docker-machine-driver-scaleway --without-docker-machine
docker-machine create -d scaleway -h
docker-machine create -d scaleway --scaleway-token=TOKEN --scaleway-organization=ACCESS_KEY --scaleway-name="cloud-scaleway-1" cloud-scaleway

2. dockerイメージからインスタンスを作成し、docker machineのgeneric driverを入れる

docker用のイメージ(Ubuntu 16.04 LTS)から、
ubuntuのdocker削除して、dockerの公式リポジトリに入れ替えるのがよさそう。

scw start $(scw create docker)

scw ps

# ipをメモる

docker 削除

ssh root@IPアドレス

apt-get autoremove --purge docker-engine
 
# Nothing worked until I added this step
rm -rfv /var/lib/docker
 
# 再起動

dockerの公式リポジトリを利用する

最新のAPIがつかえるように

curl -sSL https://get.docker.com/ | sh

docker-machine create \
  --driver generic \
  --generic-ip-address=XXX.XXX.XXX.XXX \
  --generic-ssh-key ~/.ssh/id_rsa \
  --generic-ssh-user=root \
  scw-dXXXXX

# 出力
Running pre-create checks...
Creating machine...
(admiring-golick) Importing SSH key...
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(systemd)...
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-dXXXXX
docker-machine ls

eval $(docker-machine env scw-dXXXXX)
docker ps

OK!

ubuntu管理下のdockerは、API versionの同期が取れず繋がらないことがある

docker-machine ls

eval $(docker-machine env scw-dXXXXX)
docker ps

# 出力
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)

3. ubuntuに入れる

scalewayで用意しているカーネルが最新のlinuxでビルドしているため、linux-image-extra-virtualと一緒に標準のkernelをいれると起動不可になるため、docker用のイメージを使ったほうが楽そう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?