Skip to content

Instantly share code, notes, and snippets.

@mavenugo
Created February 16, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavenugo/6677849bcab8c8bc7f92b19e3dd69fc2 to your computer and use it in GitHub Desktop.
Save mavenugo/6677849bcab8c8bc7f92b19e3dd69fc2 to your computer and use it in GitHub Desktop.
Welcome to Docker!
swarm-manager000000:~$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
cuyf1apbwj4c7f3ky3h2h7dly * swarm-manager000000 Ready Active Leader
w2mt3gdaulwnifxrvqbrg41z8 swarm-worker000001 Ready Active
wj7butznsvr6yq5adrxi64v1l swarm-worker000000 Ready Active
swarm-manager000000:~$ docker plugin ls
ID NAME DESCRIPTION ENABLED
189f70543802 docker4x/cloudstor:latest cloud storage plugin for Docker true
swarm-manager000000:~$ docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 21:19:34 2017
OS/Arch: linux/amd64
Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 21:19:34 2017
OS/Arch: linux/amd64
Experimental: true
swarm-manager000000:~$ docker service create --replicas 5 --name ping1 --mount typ
e=volume,volume-driver=docker4x/cloudstor:latest,source=sharedvol1,destination=/sh
areddata alpine ping docker.com
qtdnzqffmi64lvpwl1wac0lsb
swarm-manager000000:~$ docker ps | grep ping
246dc14611ac alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 "ping docker.com" 6 seconds ago Up 3 seconds ping1.2.5yzzpzohukvnvgl44wd4jnafm
swarm-manager000000:~$ docker exec -it 246dc14611ac sh
/ # touch /shareddata/sharedfile
/ # echo 1 > /shareddata/sharedfile
/ # cat /shareddata/sharedfile
1
/ # exit
swarm-manager000000:~$ ssh docker@swarm-worker000000
The authenticity of host 'swarm-worker000000 (10.0.0.4)' can't be established.
RSA key fingerprint is SHA256:v3lqz2ypZ3p/jnaRlH3rx9BGAyffo4qrayUTEIkpTpY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'swarm-worker000000,10.0.0.4' (RSA) to the list of known hosts.
Welcome to Docker!
swarm-worker000000:~$ docker ps | grep ping
23b9f2c36617 alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 "ping docker.com" About a minute ago Up About a minute ping1.4.2687uop11acrmtvj4rj0a9nz0
61aef1c77fdc alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 "ping docker.com" About a minute ago Up About a minute ping1.1.zo8cmcma0yk4i1b4hsnh492o3
swarm-worker000000:~$ docker exec -it 61aef1c77fdc sh
/ # cat /shareddata/sharedfile
1
/ # echo 2 > /shareddata/sharedfile
/ # cat /shareddata/sharedfile
2
/ # exit
swarm-worker000000:~$ exit
Connection to swarm-worker000000 closed.
swarm-manager000000:~$ ssh docker@swarm-worker000001
The authenticity of host 'swarm-worker000001 (10.0.0.5)' can't be established.
RSA key fingerprint is SHA256:MoPGlqw9ucxdjhGLELnK7HXESwCppQoJwDWAp7leOdo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'swarm-worker000001,10.0.0.5' (RSA) to the list of known hosts.
Welcome to Docker!
swarm-worker000001:~$ docker ps | grep ping
e71a728a8590 alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 "ping docker.com" About a minute ago Up About a minute ping1.5.yjxb8zdbcv7oahgb0sppjcti0
363b84bc145d alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 "ping docker.com" About a minute ago Up About a minute ping1.3.swzshj0883x6xz1kwul6g9cx6
swarm-worker000001:~$ docker exec -it 363b84bc145d cat /shareddata/sharedfile
2
swarm-worker000001:~$ exit
Connection to swarm-worker000001 closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment