Skip to content

Commit

Permalink
Merge pull request #3476 from aledbf/fix-docker-permissions
Browse files Browse the repository at this point in the history
Fix nginx directory permissions
  • Loading branch information
k8s-ci-robot authored Nov 28, 2018
2 parents 710ea8c + c4d6e8f commit 7b79341
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ RUN clean-install \
diffutils \
libcap2-bin

COPY . /
COPY --chown=www-data:www-data . /

# Fix permission during the build to avoid issues at runtime
# with volumes (custom templates)
RUN bash -eu -c ' \
writeDirs=( \
/etc/nginx/template \
/etc/ingress-controller/ssl \
/etc/ingress-controller/auth \
/var/log \
Expand All @@ -38,9 +37,7 @@ RUN bash -eu -c ' \
for dir in "${writeDirs[@]}"; do \
mkdir -p ${dir}; \
chown -R www-data.www-data ${dir}; \
done' \
&& chown www-data.www-data /etc/nginx/nginx.conf \
&& chown www-data.www-data /etc/nginx/opentracing.json
done'

RUN setcap cap_net_bind_service=+ep /nginx-ingress-controller \
&& setcap -v cap_net_bind_service=+ep /nginx-ingress-controller
Expand Down

0 comments on commit 7b79341

Please sign in to comment.