LoginSignup
0
0

More than 5 years have passed since last update.

docker で build した別の image から COPY する

Posted at

例えば、 laravel や Rails などで、 build(npm run prod(laravel の例)等) 済みの js とか css とかを nginx や apche 用の Container に COPY したいケースなどで使う方法のメモ。

  • nginx や apache Container の docker build 前に laravel や Rails の Container で js や css は生成(build)済みとする。
  • かつ、 laravel や Rails の Container の Image の名称は workspace とする
  • かつ、 js, css は /var/www/app/public/js/*, /var/www/app/public/css/* に存在するとする
# ..snip..
COPY --from=workspace /var/www/app/public/js /var/www/app/public/js
COPY --from=workspace /var/www/app/public/css /var/www/app/public/css
# ..snip..

みたいに COPY 命令に --from=IMAGE_NAME で指定する。

※用語がごちゃごちゃかも。気が向いたらちゃんと書く。

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