forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow running ambassador as a non-privileged user
This commit lets ambassador to be run as a non-root user and moves all ambassador related configurations to /ambassador inside the container. Fix emissary-ingress#457
- Loading branch information
Showing
4 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,18 +21,18 @@ LABEL PROJECT_REPO_URL = "[email protected]:datawire/ambassador.git" \ | |
VENDOR_URL = "https://datawire.io/" | ||
|
||
# This Dockerfile is set up to install all the application-specific stuff into | ||
# /application. | ||
# /ambassador. | ||
# | ||
# NOTE: If you don't know what you're doing, it's probably a mistake to | ||
# blindly hack up this file. | ||
|
||
RUN apk --no-cache add curl python3 | ||
|
||
# Set WORKDIR to /application which is the root of all our apps then COPY | ||
# Set WORKDIR to /ambassador which is the root of all our apps then COPY | ||
# only requirements.txt to avoid screwing up Docker caching and causing a | ||
# full reinstall of all dependencies when dependencies are not changed. | ||
|
||
WORKDIR /application | ||
ENV AMBASSADOR_ROOT=/ambassador | ||
WORKDIR ${AMBASSADOR_ROOT} | ||
COPY requirements.txt . | ||
|
||
# Install application dependencies | ||
|
@@ -43,12 +43,18 @@ COPY ./ ambassador | |
RUN cd ambassador && python3 setup.py --quiet install | ||
RUN rm -rf ./ambassador | ||
|
||
# MKDIR an empty /etc/ambassador-config. You can dump a configmap over this with no | ||
# trouble, or you can let annotations do the right thing. | ||
RUN mkdir /etc/ambassador-config | ||
# MKDIR an empty /ambassador/ambassador-config. You can dump a | ||
# configmap over this with no trouble, or you can let | ||
# annotations do the right thing | ||
RUN mkdir ambassador-config | ||
|
||
# COPY in a default config for use with --demo. | ||
COPY default-config/ /etc/ambassador-demo-config | ||
COPY default-config/ ambassador-demo-config | ||
|
||
# Fix permissions to allow running as a non root user | ||
RUN chgrp -R 0 ${AMBASSADOR_ROOT} && \ | ||
chmod -R u+x ${AMBASSADOR_ROOT} && \ | ||
chmod -R g=u ${AMBASSADOR_ROOT} /etc/passwd | ||
|
||
# COPY the entrypoint script and make it runnable. | ||
COPY kubewatch.py . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters