docker ubuntu ssh client 설치 & push & pull
1. docker ubuntu ssh client 설치 및 접속
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 12 hours ago Up About an hour 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montalcini
1b14c702a2cb ubuntu "bash" 21 hours ago Exited (130) 4 seconds ago focused_dubinsky
PS C:\Users\myung> docker attach 1b14c702a2cb
docker exec -it 1b14c702a2cb bash (이렇게 해도 실행된다. 무슨차이??)
root@1b14c702a2cb:/usr/bin# apt-get update
root@1b14c702a2cb:/usr/bin# apt-get install openssh-client
root@1b14c702a2cb:/usr/bin# ssh 192.168.1.243 -p 49160
2. modified ubuntu image 만들기
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 12 hours ago Up 2 hours 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montalcini
1b14c702a2cb ubuntu "bash" 22 hours ago Exited (0) 5 minutes ago focused_dubinsky
PS C:\Users\myung> docker commit 1b14c702a2cb jmyung/modified-ubuntu
sha256:1bab40e82f3e32a8a82d508d7b3fbb60f161c34bc3368ec6e02282a7dc827da3
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jmyung/modified-ubuntu latest 1bab40e82f3e 19 seconds ago 184 MB
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker run -it -d jmyung/modified-ubuntu bash
3f1e5de5c78c72508aaca97799f10f4f85eb8dfce60e6c60ddbed0eaf33dd954
PS C:\Users\myung>
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3f1e5de5c78c jmyung/modified-ubuntu "bash" 12 seconds ago Up 12 seconds sharp_austin
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 12 hours ago Up 2 hours 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montalcini
1b14c702a2cb ubuntu "bash" 22 hours ago Exited (0) 6 minutes ago focused_dubinsky
PS C:\Users\myung> docker attach 3f1e5de5c78c
3. image rename
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
jmyung/modified-ubuntu latest 1bab40e82f3e 4 minutes ago 184 MB
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
ello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker tag 1bab40e82f3e human537/modified-ubuntu
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
human537/modified-ubuntu latest 1bab40e82f3e 6 minutes ago 184 MB
jmyung/modified-ubuntu latest 1bab40e82f3e 6 minutes ago 184 MB
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker rmi jmyung/modified-ubuntu
Untagged: jmyung/modified-ubuntu:latest
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
human537/modified-ubuntu latest 1bab40e82f3e 7 minutes ago 184 MB
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
4. login & push
PS C:\Users\myung> docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: human537
Password:
Login Succeeded
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
human537/jmyung modified-ubuntu 1bab40e82f3e 41 minutes ago 184 MB
human537/modified-ubuntu latest 1bab40e82f3e 41 minutes ago 184 MB
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker push human537/modified-ubuntu
The push refers to a repository [docker.io/human537/modified-ubuntu]
3634175b47ba: Pushed
56827159aa8b: Pushed
440e02c3dcde: Pushed
29660d0e5bb2: Pushed
85782553e37a: Pushed
745f5be9952c: Pushed
latest: digest: sha256:477821c9bed41182bce393be27e82a3cf492dc911d06a3fe8a9b4108532fabff size: 1569
PS C:\Users\myung> docker push human537/jmyung:modified-ubuntu
The push refers to a repository [docker.io/human537/jmyung]
3634175b47ba: Mounted from human537/modified-ubuntu
56827159aa8b: Mounted from human537/modified-ubuntu
440e02c3dcde: Mounted from human537/modified-ubuntu
29660d0e5bb2: Mounted from human537/modified-ubuntu
85782553e37a: Mounted from human537/modified-ubuntu
745f5be9952c: Mounted from human537/modified-ubuntu
modified-ubuntu: digest: sha256:477821c9bed41182bce393be27e82a3cf492dc911d06a3fe8a9b4108532fabff size: 1569
5. 이미지 삭제 & pull
PS C:\Users\myung> docker rmi 1bab40e82f3e
Error response from daemon: conflict: unable to delete 1bab40e82f3e (must be forced) - image is referenced in multiple repositories
PS C:\Users\myung> docker rmi -f 1bab40e82f3e
Untagged: human537/jmyung:modified-ubuntu
Untagged: human537/jmyung@sha256:477821c9bed41182bce393be27e82a3cf492dc911d06a3fe8a9b4108532fabff
Untagged: human537/modified-ubuntu:latest
Untagged: human537/modified-ubuntu@sha256:477821c9bed41182bce393be27e82a3cf492dc911d06a3fe8a9b4108532fabff
Deleted: sha256:1bab40e82f3e32a8a82d508d7b3fbb60f161c34bc3368ec6e02282a7dc827da3
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3f1e5de5c78c 1bab40e82f3e "bash" 53 minutes ago Exited (130) 52 minutes ago sharp_austin
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 13 hours ago Up 2 hours 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montal
1b14c702a2cb ubuntu "bash" 23 hours ago Exited (0) About an hour ago focused_dubin
PS C:\Users\myung>
PS C:\Users\myung> docker rm 3f1e5de5c78c 1b14c702a2cb
3f1e5de5c78c
1b14c702a2cb
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 13 hours ago Up 3 hours 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montalcini
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0ef2e08ed3fa 4 weeks ago 130 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker rmi 0ef2e08ed3fa
Untagged: ubuntu:latest
Untagged: ubuntu@sha256:dd7808d8792c9841d0b460122f1acf0a2dd1f56404f8d1e56298048885e45535
Deleted: sha256:0ef2e08ed3fabfc44002ccb846c4f2416a2135affc3ce39538834059606f32dd
Deleted: sha256:0d58a35162057295d273c5fb8b7e26124a31588cdadad125f4bce63b638dddb5
Deleted: sha256:cb7f997e049c07cdd872b8354052c808499937645f6164912c4126015df036cc
Deleted: sha256:fcb4581c4f016b2e9761f8f69239433e1e123d6f5234ca9c30c33eba698487cc
Deleted: sha256:b53cd3273b78f7f9e7059231fe0a7ed52e0f8e3657363eb015c61b2a6942af87
Deleted: sha256:745f5be9952c1a22dd4225ed6c8d7b760fe0d3583efd52f91992463b53f7aea3
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker run -it -d human537/modified-ubuntu
Unable to find image 'human537/modified-ubuntu:latest' locally
latest: Pulling from human537/modified-ubuntu
fec6b243e075: Pull complete
190e0e9a3e79: Pull complete
0d79cf192e4c: Pull complete
38398c307b51: Pull complete
356665655a72: Pull complete
1bfe0107edf2: Pull complete
Digest: sha256:477821c9bed41182bce393be27e82a3cf492dc911d06a3fe8a9b4108532fabff
Status: Downloaded newer image for human537/modified-ubuntu:latest
77e0c9e2a27d640fcf93b8552b5ad244c0f8dc7563d1495de4e9a38803c7707f
PS C:\Users\myung>
PS C:\Users\myung> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
human537/modified-ubuntu latest 1bab40e82f3e About an hour ago 184 MB
wnameless/oracle-xe-11g latest 51fad6f11394 6 weeks ago 2.24 GB
hello-world latest 48b5124b2768 2 months ago 1.84 kB
PS C:\Users\myung> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
77e0c9e2a27d human537/modified-ubuntu "bash" 2 minutes ago Up 2 minutes infallible_kowalevski
cc718514202e wnameless/oracle-xe-11g "/bin/sh -c '/usr/..." 13 hours ago Up 3 hours 8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp frosty_montalcini
PS C:\Users\myung> docker attach 77e0c9e2a27d
root@77e0c9e2a27d:/#
root@77e0c9e2a27d:/#
root@77e0c9e2a27d:/# ll
total 72
drwxr-xr-x 1 root root 4096 Apr 2 05:58 ./
drwxr-xr-x 1 root root 4096 Apr 2 05:58 ../
-rwxr-xr-x 1 root root 0 Apr 2 05:58 .dockerenv*
'Cloud > Bluemix' 카테고리의 다른 글
3-2 webinar (0) | 2017.04.04 |
---|---|
3-1 (0) | 2017.04.03 |
docker에 oracle 설치 (0) | 2017.04.02 |
2-5 (0) | 2017.03.31 |
111 (0) | 2017.03.28 |