Skip to content

Commit 7e80e80

Browse files
committed
optimize installation process
1 parent e80616a commit 7e80e80

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ MAINTAINER Maik Hummel <m@ikhummel.com>
44
# Build-Variables
55
ENV NODEJS_VERSION 5.0.0
66

7-
# Set Environment Variables
8-
ENV PATH $PATH:/opt/nodejs/bin
7+
# Set PATH variable
8+
ENV PATH $PATH:/opt/node/bin
99

10-
WORKDIR "/opt"
10+
WORKDIR "/opt/node"
1111

12-
RUN curl -O https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz && \
12+
RUN apt-get update && apt-get install -y curl ca-certificates --no-install-recommends && \
1313

14-
# Extract and move to /opt
15-
tar xf node-v${NODEJS_VERSION}-linux-x64.tar.gz && \
16-
mv node-v${NODEJS_VERSION}-linux-x64 /opt/nodejs && \
17-
18-
# Clean up
19-
rm node-v${NODEJS_VERSION}-linux-x64.tar.gz
14+
curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar xz --strip-components=1 && \
15+
16+
# clean up
17+
rm -rf /var/lib/apt/lists/* && \
18+
apt-get clean

0 commit comments

Comments
 (0)