33
18

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.

DockerfileのRUNとCMD、docker-compose.yaml内のマウントタイミング

Posted at

#例えば

docker-compose.yml
build: './test'
volumes:
  - ./:/var/www/html
test/Dockerfile
RUN chmod +x /var/www/html     # var/www/html not found
CMD chmod +x /var/www/html     # 思い通りに動く

docker-compose.yamlでマウントしたファイルに対して、Dockerfileで操作したいときは
RUNではなくCMDを使う。

順番は、RUNvolumesCMDだ。

33
18
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
33
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?