Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker 로 ubuntu IMG 를 받아서 NGINX 설치하기 #1

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Conversation

shimguh
Copy link
Owner

@shimguh shimguh commented Feb 15, 2024

  1. 각자 REPO 에 ubuntu-nginx 를 생성
  2. hub 에서 ubuntu pull & run
  3. (2) 에 들어가서 nginx.org 참조하여 nginx 설치
  4. (1), (2), (3) 과정 기록
  5. (4) 의 기록을 바탕으로 Dockerfile 생성
    ref
    A. https://nginx.org/en/docs/
    B. https://nginx.org/en/docs/beginners_guide.html
    C. https://docs.docker.com/engine/reference/builder/#dockerfile-reference
    D. https://github.com/nginxinc/docker-nginx/blob/1f227619c1f1baa0bed8bed844ea614437ff14fb/mainline/debian/Dockerfile#L119

@shimguh
Copy link
Owner Author

shimguh commented Feb 15, 2024

  1. rm, rmi
$ sudo docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
$ sudo docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

@shimguh
Copy link
Owner Author

shimguh commented Feb 15, 2024

  1. pull, run
$ sudo docker pull ubuntu:22.04
$ sudo docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
ubuntu       22.04     fd1d8f58e8ae   2 weeks ago   77.9MB

$ sudo docker run -itd --name ubuntu-nginx ubuntu:22.04
$ sudo docker ps
CONTAINER ID   IMAGE          COMMAND       CREATED          STATUS         PORTS     NAMES
844cb6901cb9   ubuntu:22.04   "/bin/bash"   32 seconds ago   Up 4 seconds             ubuntu-nginx

@shimguh shimguh changed the title 0.1.0 docker 로 ubuntu IMG 를 받아서 NGINX 설치하기 Feb 15, 2024
@shimguh
Copy link
Owner Author

shimguh commented Feb 15, 2024

  1. install nginx
$ sudo docker exec -it ubuntu-nginx bash
$ apt-get update
$ apt-get install nginx

@shimguh
Copy link
Owner Author

shimguh commented Feb 15, 2024

  1. Dockerfile 생성
    Dockerfil install nginx 오류 #2 (comment)
$ cat Dokcerfile
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -y nginx
EXPOSE 80
CMD ["nginx" ,"-g", "daemon off";]

$ sudo docker build -t test .
[+] Building 8.2s (7/7) FINISHED                                           docker:default
 => [internal] load build definition from Dockerfile                                 0.0s
 => => transferring dockerfile: 147B                                                 0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                      0.0s
 => [internal] load .dockerignore                                                    0.0s
 => => transferring context: 2B                                                      0.0s
 => [1/3] FROM docker.io/library/ubuntu:22.04                                        0.0s
 => CACHED [2/3] RUN apt-get update                                                  0.0s
 => [3/3] RUN apt-get install -y nginx                                               8.1s
 => exporting to image                                                               0.2s
 => => exporting layers                                                              0.1s
 => => writing image sha256:50273b2ec7cf128f853123a3e86ca914a2d3268eeed8eefa9dfd679  0.0s
 => => naming to docker.io/library/test                                              0.0s

$ sudo docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
test         latest    50273b2ec7cf   4 seconds ago   182MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant