You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow docker-nginx to run under a non root user (#68)
* Allow docker-nginx to run under a non root user
* remove additional layer when setting permissions
* Add expectations and fix nginx error log permissions
* set s6 root read only flag
* fix s6-chown issues
* merging comments
* specify username in COPY command
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ See parent(s) [docker-base](https://github.com/behance/docker-base) for addition
18
18
### Expectations
19
19
20
20
- Applications must copy their html/app into the `/var/www/html` folder
21
+
- Any new script/file that needs to be added must be given proper permissions/ownership to the non root user through `container/root/scripts/set_permissions.sh`. This is to ensure that the image can be run under a non root user.
21
22
- NOTE: Nginx is exposed and bound to an unprivileged port, `8080`
echo"deprivilege noop (s6-setuidgid): current user = set user: $set_user."
7
+
shift
8
+
exec$@
9
+
else
10
+
echo"***Warning*** Starting image as $current_user and deprivileging service to run under $set_user, future versions of this image will use $NOT_ROOT_USER as the default user set via https://docs.docker.com/engine/reference/builder/#user."
# Make s6 give non root user ownership to user provided files instead of root
15
+
# List of files/folders given ownership available here: https://github.com/just-containers/s6-overlay/blob/master/builder/overlay-rootfs/etc/s6/init/init-stage2-fixattrs.txt
16
+
sed -i "s/root/${NOT_ROOT_USER}/" /etc/s6/init/init-stage2-fixattrs.txt
0 commit comments