프로그래밍/Docker

도커 허브 퀵스타트

ZenoAhn 2019. 8. 24. 00:45

도커 허브 퀵스타트

1. https://hub.docker.com/ 로그인

2. 레포지토리 생성

3. 적당한 곳에 폴더 만들고 Dockerfile 생성

cat > Dockerfile <<EOF
FROM ubuntu
CMD echo "Hello world! This is my first Docker image."
EOF

4. build 후 이미지 생성, 도커 허브 푸쉬

docker build -t <your_username>/my-first-repo .
docker image locally by running docker run <your_username>/my-first-repo
docker push <your_username>/my-first-repo

생성된 이미지 Run docker with bash

-i, -t : 인터렉티브 터미널

docker run -i -t <your_username>/my-first-repo /bin/bash

참조

https://docs.docker.com/docker-hub/