Skip to content

Instantly share code, notes, and snippets.

@andykais
Created August 1, 2017 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andykais/b62d2a165f6996e2d7d9ac91fd599e57 to your computer and use it in GitHub Desktop.
Save andykais/b62d2a165f6996e2d7d9ac91fd599e57 to your computer and use it in GitHub Desktop.
FROM node:8-alpine
COPY entrypoint.sh /usr/bin/entrypoint.sh
# create npmrc with enviroment variable
RUN echo "\$NPM_TOKEN" > /root/.npmrc
# entrypoint script performs envsubst on npmrc
RUN printf '#!/bin/sh\n\
sed -i "s~\$NPM_TOKEN~$NPM_TOKEN~" /root/.npmrc\n\
$@' > /usr/bin/entrypoint.sh \
&& chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment