Docker(3)Docker and Docker Compose
I installed docker on my ubuntu server with easy command. But I try to install docker-compose and I ran into this issue today.
Installation of Docker Compose
> sudo curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > ./docker-compose
>sudo mv docker-compose /usr/local/bin/
> chmod +x /usr/local/bin/docker-compose
Check the version
> sudo docker version
[sudo] password for carl:
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.3.3
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.3.3
Git commit (server): a8a31ef
> sudo docker-compose --version
docker-compose version: 1.3.1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
Error Message:
> sudo docker-compose up
client and server don't have same version (client : 1.18, server: 1.17)
Solution:
Remove the old docker.io
> sudo apt-get remove docker.io
Install the latest
> wget -qO- https://get.docker.com/ | sh
> sudo apt-get install apparmor lxc cgroup-lite
> sudo usermod -aG docker carl
Start the docker service
> nohup sudo docker -d &
https://docs.docker.com/compose/
Then you can use
> sudo docker-compose up
The sample configuration will be as follow:
cat docker-compose.yml
db:
image: mysql
volumes:
- data:/var/lib/mysql
- schemas:/home/schemas
environment:
- MYSQL_ROOT_PASSWORD=6JHLb9RtvH5F
web:
build: ./ubuntu-nginx-php/
volumes:
- src:/usr/share/nginx/
ports:
- "80:80"
links:
- db
Not that easy, there is still some version issue there.
References:
docker on raspberry
https://resin.io/blog/docker-on-raspberry-pi-in-4-simple-steps/
http://blog.xebia.com/2014/08/25/docker-on-a-raspberry-pi/
Docker(3)Docker and Docker Compose
猜你喜欢
转载自sillycat.iteye.com/blog/2227400
今日推荐
周排行