"Dockerfile 여러줄 파일 생성하기"의 두 판 사이의 차이

2번째 줄: 2번째 줄:
;How to write commands with multiple lines in Dockerfile
;How to write commands with multiple lines in Dockerfile
;Dockerfile 여러줄 파일 생성하기
;Dockerfile 여러줄 파일 생성하기
==방법 1: 중괄호 ==
<syntaxhighlight lang='console'>
tester@localhost:~/temp1$ cat Dockerfile
FROM debian
RUN set -x; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
} > /tmp/php.ini \
&& cat /tmp/php.ini
</syntaxhighlight>
<syntaxhighlight lang='console'>
tester@localhost:~/temp1$ docker build -t test1 .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM debian
latest: Pulling from library/debian
57df1a1f1ad8: Pull complete
Digest: sha256:439a6bae1ef351ba9308fc9a5e69ff7754c14516f6be8ca26975fb564cb7fb76
Status: Downloaded newer image for debian:latest
---> f6dcff9b59af
Step 2/2 : RUN set -x; { echo 'opcache.memory_consumption=128'; echo 'opcache.interned_strings_buffer=8'; echo 'opcache.max_accelerated_files=4000'; echo 'opcache.revalidate_freq=60'; } > /tmp/php.ini && cat /tmp/php.ini
---> Running in 3d7f6e158ece
+ echo opcache.memory_consumption=128
+ echo opcache.interned_strings_buffer=8
+ echo opcache.max_accelerated_files=4000
+ echo opcache.revalidate_freq=60
+ cat /tmp/php.ini
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
Removing intermediate container 3d7f6e158ece
---> ab3e610f4cd3
Successfully built ab3e610f4cd3
Successfully tagged test1:latest
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 10월 8일 (목) 13:31 판

1 개요

How to write commands with multiple lines in Dockerfile
Dockerfile 여러줄 파일 생성하기

2 방법 1: 중괄호

tester@localhost:~/temp1$ cat Dockerfile
FROM debian
RUN set -x; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
} > /tmp/php.ini \
&& cat /tmp/php.ini
tester@localhost:~/temp1$ docker build -t test1 .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM debian
latest: Pulling from library/debian
57df1a1f1ad8: Pull complete
Digest: sha256:439a6bae1ef351ba9308fc9a5e69ff7754c14516f6be8ca26975fb564cb7fb76
Status: Downloaded newer image for debian:latest
 ---> f6dcff9b59af
Step 2/2 : RUN set -x; { echo 'opcache.memory_consumption=128'; echo 'opcache.interned_strings_buffer=8'; echo 'opcache.max_accelerated_files=4000'; echo 'opcache.revalidate_freq=60'; } > /tmp/php.ini && cat /tmp/php.ini
 ---> Running in 3d7f6e158ece
+ echo opcache.memory_consumption=128
+ echo opcache.interned_strings_buffer=8
+ echo opcache.max_accelerated_files=4000
+ echo opcache.revalidate_freq=60
+ cat /tmp/php.ini
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
Removing intermediate container 3d7f6e158ece
 ---> ab3e610f4cd3
Successfully built ab3e610f4cd3
Successfully tagged test1:latest

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}