Verified Commit c6d84cd0 authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

[CodiMD] Use global ARG in Dockerfile

parent 5125ca5b
FROM node:10.22.1-alpine3.11 as BUILD
ENV VERSION=2.2.0
ENV PORTCHECKER_VERSION=v1.0.6
ARG VERSION=2.2.0
ARG PORTCHECKER_VERSION=v1.0.6
FROM node:10.22.1-alpine3.11 as BUILD
ARG VERSION
RUN apk add --no-cache --virtual .gyp libressl-dev git bash python make && \
wget https://github.com/hackmdio/codimd/archive/$VERSION.tar.gz && \
wget https://github.com/hackmdio/codimd/archive/${VERSION}.tar.gz && \
tar xzf $VERSION.tar.gz -C /opt && \
mv /opt/codimd-$VERSION /opt/codimd
......@@ -18,14 +18,15 @@ RUN cd /opt/codimd && npm install && \
config.json.example README.md CONTRIBUTING.md AUTHORS node_modules
FROM node:10.22.1-alpine3.11
ARG PORTCHECKER_VERSION
RUN addgroup --gid 5010 codimd && \
adduser -u 5010 -G codimd -D codimd && \
mkdir /home/$USER_NAME/.npm && \
echo "prefix=/home/codimd/.npm/" > /home/$USER_NAME/.npmrc && \
mkdir -p /home/codimd/app && \
chown -R codimd:codimd /home/codimd && \
apk add --no-cache git bash python && \
# Git needed so NPM can clone packages and Python for node-gyp
apk add --no-cache bash git python && \
wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-amd64.tar.gz && \
tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \
mv /usr/local/bin/portchecker-linux-amd64 /usr/local/bin/pcheck && \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment