[Docker] Getting started with Docker

2024. 3. 28. 00:02ComputerScience/DockerKubernetes

 

 

 

 

 

Docker

컨테이너로 띄운 서버를 확인해보고 싶다면? 

(1) 웹브라우저 

(2) curl 

(3) python requests 

 

 

 

 

 

docker container help

 

 

 

 

 

docker version (--version은 간결한 출력)

 

 

 

 

 

1. Web browser

http://localhost:80 (앞서 지정한 port number)을 통해 컨테이너로 띄운 docker/getting-started에 들어간 모습

 

 

 

 

 

2. curl

간단한 HTTP method들을 실행할 수 있는 curl

 

 

 

 

 

3. Python requests

python requests (r.text)

 

 

 

 

 

r.json()

 

 

 

 

 

killercoda docker에서 curl로 로컬호스트 접속

 

 

 

 

 

참고자료

https://docs.docker.com/get-started/

 

Overview of the get started guide

Get started with the Docker basics in this comprehensive overview, You'll learn about containers, images, and how to containerize your first application.

docs.docker.com

https://github.com/docker/getting-started

 

GitHub - docker/getting-started: Getting started with Docker

Getting started with Docker. Contribute to docker/getting-started development by creating an account on GitHub.

github.com

 

https://curl.se

 

curl

command line tool and library for transferring data with URLs (since 1998) Supports... DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS

curl.se

https://requests.readthedocs.io/en/latest/

 

Requests: HTTP for Humans™ — Requests 2.31.0 documentation

Requests: HTTP for Humans™ Release v2.31.0. (Installation) Requests is an elegant and simple HTTP library for Python, built for human beings. Behold, the power of Requests: >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')) >>> r.

requests.readthedocs.io

https://killercoda.com

 

Killercoda Interactive Environments

Learn DevOps Linux Kubernetes CKS CKA CKAD Git Cassandra etc | Katacoda compatible

killercoda.com

여기서 VM 환경으로 이것저것 해볼 수 있는게 신기했다!

수업시간에 한 것 - nmon / lshw (하드웨어 관련된 list up) 
vi / nano (컨테이너 내부로 들어갈 때 bash,ash) - 나노를 설치해야함 
+ curl과 requests가 이미 설치됨