Last active
December 2, 2020 15:37
-
-
Save dgk/845709439da36e07044373f15d73ea7e to your computer and use it in GitHub Desktop.
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
# nginx image with fake /bin/sh | |
# to use a non-standard port: | |
# docker build --build-arg PORT=8000 . | |
FROM nginx:alpine | |
ARG PORT=80 | |
RUN sed -i "s/80/$PORT/" /etc/nginx/conf.d/default.conf | |
RUN apk add --no-cache bash | |
RUN echo -e '#!/bin/bash\nnginx -g "daemon off;"' > /bin/sh-fake | |
RUN chmod +x /bin/sh-fake | |
RUN mv /bin/sh-fake /bin/sh | |
EXPOSE $PORT | |
ENTRYPOINT /bin/sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment