psychedelicnekopunch / docker-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Started

Image for service app was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build

$ cd /path/to/docker-sample/some-sample-dir
$ docker-compose up

ctl + c で終了

Access

http://localhost:8080/

Log in

$ docker-compose up
$ docker ps
CONTAINER ID   IMAGE         COMMAND                  CREATED        STATUS          PORTS                  NAMES
ae883db57be2   nginx_nginx   "/docker-entrypoint.…"   20 hours ago   Up 10 seconds   0.0.0.0:8080->80/tcp   nginx_nginx_1

# docker exec -it [NAMES] [choose command language]
$ docker exec -it nginx_nginx_1 /bin/bash

Remove

CONTAINER

$ docker ps  -a
CONTAINER ID   IMAGE         COMMAND                  CREATED         STATUS                     PORTS     NAMES
fc961249302f   nginx_nginx   "/docker-entrypoint.…"   8 seconds ago   Exited (0) 5 seconds ago             nginx_nginx_1

# docker rm [NAMES or CONTAINER ID]
$ docker rm nginx_nginx_1

remove all container

$ cd /path/to/docker-sample
$ bin/rm_all_container

IMAGES

$ docker images
REPOSITORY    TAG       IMAGE ID       CREATED              SIZE
nginx_nginx   latest    8f81c1e617ed   About a minute ago   133MB
nginx         1         f6d0b4767a6c   9 days ago           133MB

# docker rmi [REPOSITORY or IMAGE ID] -f
# -f force 強制的に
$ docker rmi nginx_nginx -f

remove images

$ cd /path/to/docker-sample
$ bin/rmi_none

About


Languages

Language:Dockerfile 28.0%Language:Go 27.1%Language:Shell 21.5%Language:PHP 13.7%Language:HTML 9.5%Language:Hack 0.2%