Giter VIP home page Giter VIP logo

ubuntu-nginx's Introduction

ubunto IMG 받아서 nginx 설치, Dockerfile 생성

  1. rm, rmi
$ sudo docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
$ sudo docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
  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
  1. install nginx
$ sudo docker exec -it ubuntu-nginx bash
$ apt-get update
$ apt-get install nginx
  1. Dockerfile 생성
$ 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

ubuntu-nginx's People

Contributors

shimguh avatar

Watchers

 avatar

ubuntu-nginx's Issues

Dockerfil install nginx 오류

=> ERROR [3/3] RUN apt-get install nginx                                            1.2s
------
 > [3/3] RUN apt-get install nginx:
0.292 Reading package lists...
0.863 Building dependency tree...
0.992 Reading state information...
1.125 The following additional packages will be installed:
1.125   fontconfig-config fonts-dejavu-core iproute2 libatm1 libbpf0 libbrotli1
1.125   libbsd0 libcap2-bin libdeflate0 libelf1 libexpat1 libfontconfig1
1.125   libfreetype6 libgd3 libicu70 libjbig0 libjpeg-turbo8 libjpeg8 libmaxminddb0
1.125   libmd0 libmnl0 libnginx-mod-http-geoip2 libnginx-mod-http-image-filter
1.125   libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
1.125   libnginx-mod-stream-geoip2 libpam-cap libpng16-16 libtiff5 libwebp7 libx11-6
1.125   libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxslt1.1
1.126   libxtables12 nginx-common nginx-core ucf
1.127 Suggested packages:
1.127   iproute2-doc libgd-tools mmdb-bin fcgiwrap nginx-doc ssl-cert
1.167 The following NEW packages will be installed:
1.167   fontconfig-config fonts-dejavu-core iproute2 libatm1 libbpf0 libbrotli1
1.167   libbsd0 libcap2-bin libdeflate0 libelf1 libexpat1 libfontconfig1
1.168   libfreetype6 libgd3 libicu70 libjbig0 libjpeg-turbo8 libjpeg8 libmaxminddb0
1.168   libmd0 libmnl0 libnginx-mod-http-geoip2 libnginx-mod-http-image-filter
1.168   libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
1.168   libnginx-mod-stream-geoip2 libpam-cap libpng16-16 libtiff5 libwebp7 libx11-6
1.168   libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxslt1.1
1.168   libxtables12 nginx nginx-common nginx-core ucf
1.175 0 upgraded, 44 newly installed, 0 to remove and 2 not upgraded.
1.175 Need to get 17.6 MB of archives.
1.175 After this operation, 56.4 MB of additional disk space will be used.
1.175 Do you want to continue? [Y/n] Abort.
------
Dockerfile:4
--------------------
   2 |
   3 |     RUN apt-get update
   4 | >>> RUN apt-get install nginx
   5 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install nginx" did not complete successfully: exit code: 1

RUN apt-get install nginx -> RUN apt-get install -y nginx
-y 옵션 추가

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.