0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dockerで自分のコンテナだけ作り直す方法

Posted at
  • 環境(ホスト)
    • CentOS Linux release 7.6.1810 (Core)
    • Docker version 18.09.6, build 481bc77156

docker-compose.ymlには他の人のコンテナ情報も書いてあり、

docker-compose.yml
version: "3.7"
services:
  ponsuke:
    build:
      context: .
# 省略
  usagi:
    build:
      context: .
# 省略

他の人のコンテナも可動している状態で

$ docker ps
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                    NAMES
5aa1affa8d97        host-doubutu_usagi   "/usr/sbin/init"    19 hours ago        Up About an hour    0.0.0.0:8081->8080/tcp   usagi
1492c544d745        1a83763d4bd9         "/usr/sbin/init"    2 days ago          Up About an hour    0.0.0.0:8082->8080/tcp   ponsuke

自分のコンテナだけビルドして作り直す

$ docker-compose up -d --build ponsuke
Building ponsuke
Step 1/56 : FROM centos:7.6.1810
 ---> f1cb7csd5qb7
# 省略
Successfully built 12b702919589
Successfully tagged host-doubutu_ponsuke:latest
Recreating ponsuke ... done
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?