From f267894f32623c2b08a8c93708c83c9ba7325c08 Mon Sep 17 00:00:00 2001 From: "Zhuohuan LI (CARPE DIEM)" Date: Thu, 3 Nov 2016 04:16:02 +0000 Subject: [PATCH] rewrite to add labels, strip chromedriver from npm, include shellchecker and rm npm cache --- Dockerfile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e3572a1e..2f3bc614 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,11 @@ # Wechaty Docker # https://github.com/wechaty/wechaty # -FROM alpine +# FROM alpine +# +# Docker image for Alpine Linux with latest ShellCheck, a static analysis tool for shell scripts. +# https://hub.docker.com/r/nlknguyen/alpine-shellcheck/ +FROM nlknguyen/alpine-shellcheck MAINTAINER Zhuophuan LI RUN apk update && apk upgrade \ @@ -29,20 +33,28 @@ RUN sed -i '/chromedriver/d' package.json \ && npm --progress=false install > /dev/null \ && rm -fr /tmp/* ~/.npm -COPY . . -RUN sed -i '/chromedriver/d' package.json \ - && npm --progress=false link - # Loading from node_modules Folders: https://nodejs.org/api/modules.html # If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached. -RUN mkdir /bot \ - && ln -s /usr/local/lib/node_modules / \ +COPY . . +RUN sed -i '/chromedriver/d' package.json \ + && npm --progress=false link \ + \ + && mkdir /bot \ + \ + && mkdir /node_modules && ln -s /wechaty /node_modules \ + \ + && ln -s /wechaty/bin/xvfb-run /usr/local/bin \ && ln -s /wechaty/tsconfig.json / \ - && ln -s /wechaty/bin/xvfb-run /usr/local/bin + \ + && echo 'Linked wechaty to global' VOLUME [ "/bot" ] ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ] CMD [ "start" ] +LABEL org.label-schema.license=ISC \ + org.label-schema.vcs-ref=master \ + org.label-schema.vcs-url=https://github.com/wechaty/wechaty + #RUN npm test -- GitLab