Skip to content
Update Docker authored by umaumax's avatar umaumax
......@@ -4,6 +4,34 @@
### デフォルトのユーザをrootにしない
uidをホストのユーザと同じにすると、コードエディタで中間生成物などにアクセスして補完機能を利用する場合などにファイルアクセス時に問題が発生しなくなる
### catのheredoc記法はデフォルトでは利用できない
[Dockerfile内でファイルへ複数行書き込む処理をさせる | 森羅万象テーブル]( https://www.tssol.net/blog/2020/05/27/write-multiple-lines-to-file-in-dockerfile/ )
#### 新しい記法ではRUNへのheredoc記法が有効になっている
[Introduction to heredocs in Dockerfiles - Docker Blog]( https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/ )
``` bash
DOCKER_BUILDKIT=1 docker build
# or
doker buildx build
```
`apt-get``&&`で連結させなくとも良い
e.g.
``` Dockerfile
# syntax=docker/dockerfile:1.3-labs
RUN python3 <<EOF > /hello
print("Hello")
print("World")
EOF
COPY <<EOF /usr/share/nginx/html/index.html
(your index page goes here)
EOF
```
## Docker Compose
dockerは基本的にDocker Composeを利用して立ち上げること
......
......