-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require SYS_ADMIN only in DEV context not PROD. #142
Comments
You're welcome to fork this at version 0.18 and continue using from there. The reason why we now require the new caps is because we're mounting the webroot using a bindfs mount. This has several useful implications that you can find described in greater detail here. I'm not interested in reverting back because the benefits gained by using bindfs far outweigh the risks of adding the cap. |
Hi again, Sorry I didn't mean to suggest reverting. What I've done in my dockerfile is the following: # This requires cap SYS_ADMIN. Should only be activated in DEV
ONBUILD ARG PROD=${PROD:-"true"}
ONBUILD ENV PROD=${PROD}
ONBUILD RUN if ${PROD} -eq "true"; then \
echo "Not a development environment, building with symlink" && \
sudo mkdir -p /app \
&& sudo rm -fr /var/www/html \
&& sudo chown admin:admin -R /app \
&& sudo chmod 0766 -R /app \
&& sudo chmod a+X /app \
&& sudo ln -s /app /var/www/html \
&& sudo chown apache:admin -h /var/www/html; \
else \
echo "Development environment, building with bindfs" && \
printf '%s\t%s\t%s\t%s%s%s%s%s%s%s%s\t%d\t%d\n' \
'/app' \
'/var/www/html' \
'fuse.bindfs' \
'force-user=apache,' \
'force-group=apache,' \
'create-for-user=admin,' \
'create-for-group=admin,' \
'create-with-perms=0644:a+X,' \
'chgrp-ignore,' \
'chown-ignore,' \
'chmod-ignore' \
0 \
0 | sudo tee -a /etc/fstab; \
fi You might not need the ONBUILD (which I use to configure dependent images). This takes a build arg Hope this makes it clearer. By the way, indeed I'm already using a fork, but gladly now of Cheers, Jun |
Can you expand on this? (the Also, having the conditional in the Dockerfile is not going to be possible because it will require everyone who uses this project to build from source, which I think most are not doing currently. |
Hi there,
Thanks a lot for the articles and this repo! I wanted to share that I've been hesitant to upgrade to
0.19.0
because I'm using this container in kubernetes but the requiredSYS_ADMIN
cap is great for development, but not something I want to enable in k8s.Let me know if this doesn't make sense!
Jun
The text was updated successfully, but these errors were encountered: