2
2

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 1 year has passed since last update.

dockerのpullオプション

Last updated at Posted at 2022-07-23

絶対に最新のdockerイメージを使いたいと思ったとき。
(事前にpullすればいいのでは?でも、忘れちゃうこともあるじゃないですか?)

下記はdocker imageが存在している場合でもpull してくれるようです。

docker run --pull always
docker create --pull always

docker build --pull
docker-compose build --pull

https://docs.docker.com/engine/reference/commandline/build/#options
https://docs.docker.com/engine/reference/commandline/run/#options
https://docs.docker.com/engine/reference/commandline/create/#options
https://docs.docker.com/engine/reference/commandline/compose_build/#options

下記の--quiet-pullはdocker imageが存在している場合pullしてくれないようです。。
※出力をしないようにするだけ。

docker-compose up -d --quiet-pull
docker compose run --quiet-pull  # Docker Compose V2からっぽい

https://docs.docker.com/engine/reference/commandline/compose_up/#options
https://docs.docker.com/engine/reference/commandline/compose_run/#options

ちなみに、docker-compose up--force-recreateは、docker imageが存在している場合pullしてくれないので、事前にpullしておく必要がありそう。

docker-compose pull
docker-compose up -d --force-recreate

以上です。

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?