2016-10-06 2 views
0

.conf 파일을 업데이트하고 싶지만 무엇을해도 업데이트되지 않습니까? 해결 방안은 무엇인가?Dockerfile을 통해 설정 파일을 업데이트하는 방법

dockerfile 이제이 간단하다 :

FROM nginx:latest 

COPY ./default.conf /etc/nginx/conf.d/default.conf 

그냥 루트 폴더 변경을 원하기 때문에이를 업데이트해야합니다.

server { 
    listen 80 default_server; 
    root /var/www/html/public; 
    index index.html index.php; 

    charset utf-8; 

    location/{ 
     try_files $uri $uri/ /index.php?$query_string; 
    } 

    location = /favicon.ico { access_log off; log_not_found off; } 
    location = /robots.txt { access_log off; log_not_found off; } 

    access_log off; 
    error_log /var/log/nginx/error.log error; 

    sendfile off; 

    client_max_body_size 100m; 

    location ~ \.php$ { 
     fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     fastcgi_pass php:9000; 
     fastcgi_index index.php; 
     include fastcgi_params; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     fastcgi_intercept_errors off; 
     fastcgi_buffer_size 16k; 
     fastcgi_buffers 4 16k; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 
} 
+0

"내가하는 일은 무엇이든 업데이트되지 않습니다."- 정확히 무엇을하고 있습니까? – jwodder

+0

도커 빌드 -t containerid. 내 인덱스 파일을 공용 폴더에서 시작하고 싶습니다. 그게 다야. –

+0

사용자'USER root' 설정 시도 – VladoDemcak

답변

0

내가 볼 수있는 Dockerfile에는 아무런 문제가 없습니다.

> echo 'FROM nginx:latest' > Dockerfile 
> echo 'COPY ./default.conf /etc/nginx/conf.d/default.conf' >> Dockerfile 
> echo 'server {}' > default.conf 
> docker build -t temp . 

가 제대로 구축하고 파일을 이미지로 복사됩니다 :

> docker run temp cat /etc/nginx/conf.d/default.conf 
server {} 

당신의 docker build 명령의 출력은 무엇입니까 나는 예상대로 모든 일의 기본 conf의 파일을 복제 할 때?

관련 문제