File tree Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
55
55
# Set nginx to listen on defined port \
56
56
sed -i "s/listen [0-9]*;/listen ${CONTAINER_PORT};/" $CONF_NGINX_SITE
57
57
58
- RUN goss -g goss.nginx.yaml validate
58
+ RUN goss -g goss.nginx.yaml validate && \
59
+ /tmp/aufs_hack.sh
59
60
60
61
# Using a non-privileged port to prevent having to use setcap internally
61
62
EXPOSE ${CONTAINER_PORT}
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
41
41
bash -c "chown www-data:www-data /var/{lib,log}/nginx -Rh" && \
42
42
bash -c "chmod 0755 -R /var/{lib,log}/nginx"
43
43
44
- RUN goss -g goss.nginx.yaml validate
44
+ RUN goss -g goss.nginx.yaml validate && \
45
+ /tmp/aufs_hack.sh
45
46
46
47
# Using a non-privileged port to prevent having to use setcap internally
47
48
EXPOSE ${CONTAINER_PORT}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Use this to wipe the temp files/folders generated when `nginx -t`
4
+ # NOTE: must be run after a goss test!
5
+ #
6
+ # @see https://github.com/docker/docker/issues/20240
7
+ #
8
+ # In some versions of AUFS, permissions do not set/inherit properly.
9
+ # This can cause folders that are created in a different layer than
10
+ # they are used to not properly respect permissions.
11
+ #
12
+ # For example, when testing nginx's configuration, the temp folders
13
+ # are generated, but cannot be accessed by nginx while running.
14
+
15
+ echo " [hack] removing test nginx files and folders"
16
+
17
+ rm -rfv \
18
+ /tmp/.nginx/client_body \
19
+ /tmp/.nginx/fastcgi_temp \
20
+ /tmp/.nginx/scgi_temp \
21
+ /tmp/.nginx/uwsgi_temp \
22
+ /tmp/.nginx/proxy_temp \
23
+ /tmp/.nginx/nginx.pid
Original file line number Diff line number Diff line change 9
9
S6_KILL_GRACETIME : 1
10
10
volumes :
11
11
- ./container/root/goss.nginx.yaml:/goss.nginx.yaml
12
+ - ./container/root/var/www/html:/var/www/html
12
13
alpine :
13
14
build : .
14
15
dockerfile : Dockerfile-alpine
You can’t perform that action at this time.
0 commit comments