컨테이너로 이미지 만드는 명령어

먼저 아래의 명령어로 현재 Docker의 컨테이너를 확인해 봅니다.

copy bashadmin@myNAS:~# docker ps -a

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                      PORTS                     NAMES
999999999999        strapi/strapi:latest            "docker-entrypoint.s…"   2 months ago        Up 25 hours                 0.0.0.0:6650->1337/tcp    strapi_strapi
999999999999        adminer:latest                  "entrypoint.sh docke…"   2 months ago        Up 25 hours                 0.0.0.0:6660->8080/tcp    strapi_adminer
999999999999        postgres:latest                 "docker-entrypoint.s…"   2 months ago        Up 25 hours                 0.0.0.0:15432->5432/tcp   strapi_postgres
999999999999        mongo:latest                    "docker-entrypoint.s…"   3 months ago        Exited (0) 2 months ago                               strapi_mongo
999999999999        mongo-express:latest            "tini -- /docker-ent…"   3 months ago        Exited (143) 2 months ago                             strapi_mongo-express
999999999999        synology/docviewer:1.3.0.0125   "sh -c 'while true; …"   3 months ago        Up 25 hours                                           synology_docviewer_2
999999999999        synology/docviewer:1.3.0.0125   "sh -c 'while true; …"   3 months ago        Up 25 hours                                           synology_docviewer_1

이제 이 중에서 하나의 컨테이너(strapi_strapi)를 이미지로 만들어 보도록 하겠습니다. 명령어 형식은 아래와 같습니다.

docker commit [컨테이너명] [이미지명:태그]

copy bashadmin@myNAS:~# docker commit strapi_strapi test_strapi:1.0

새로 생성된 이미지 확인

이제 생성된 이미지를 확인 볼 수 있습니다. 먼저 명령 프롬프트에서는 아래의 명령어로 확인할 수 있습니다.

docker images 명령어로 현재의 이미지를 확인할 수 있습니다. 또한 다.

copy bashadmin@myNAS:~# docker images

REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
test_strapi             1.0                 3a43b73d9e04        6 hours ago         1.15GB
postgres                latest              c5ec7353d87d        2 months ago        314MB
strapi/strapi           latest              87ed59852c1d        2 months ago        997MB

또한 synology의 Docker에서도 확인할 수 있습니다.

  1. Synology의 Docker의 좌측 메뉴 중 이미지 메뉴를 선택합니다.
  2. 우측 리스트 중 test_strapi:1.0 이미지를 확인할 수 있습니다.
  3. 또한 리스트를 선택한 후 내보내기를 선택하면 이미지를 따로 저장도 가능합니다.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다