-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
710076c
commit bfbde74
Showing
3 changed files
with
35 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# gokaygurcan/dockerfile-node | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = true | ||
|
||
[Dockerfile] | ||
indent_size = 4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,57 +3,51 @@ | |
FROM gokaygurcan/ubuntu:latest | ||
|
||
# metadata | ||
LABEL maintainer = "Gökay Gürcan <[email protected]>" | ||
LABEL com.gokaygurcan.project.name = "dockerfile-node" | ||
LABEL com.gokaygurcan.project.version = "1.2.2" | ||
LABEL org.label-schema.name = "dockerfile-node" | ||
LABEL org.label-schema.description = "Node.js with npm, Yarn and N|Solid." | ||
LABEL org.label-schema.vcs-url = "https://github.com/gokaygurcan/dockerfile-node" | ||
LABEL org.label-schema.vendor = "gokaygurcan" | ||
LABEL org.label-schema.version = "1.2.2" | ||
LABEL org.label-schema.schema-version = "1.0" | ||
LABEL maintainer "Gökay Gürcan <[email protected]>" | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" \ | ||
USR_SRC_NODE=/usr/src/node \ | ||
NS_NODE=node_10.x \ | ||
NS_NSOLID=nsolid_3.x \ | ||
NS_DISTRO=bionic | ||
|
||
USER root | ||
|
||
RUN mkdir -p ${USR_SRC_NODE} | ||
|
||
WORKDIR ${USR_SRC_NODE} | ||
RUN curl -sLf -o /dev/null "https://deb.nodesource.com/${NS_NODE}/dists/${NS_DISTRO}/Release" && \ | ||
RUN mkdir -p /usr/src/node && \ | ||
cd /usr/src/node && \ | ||
# install node | ||
curl -sLf -o /dev/null "https://deb.nodesource.com/${NS_NODE}/dists/${NS_DISTRO}/Release" && \ | ||
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ | ||
echo "deb https://deb.nodesource.com/${NS_NODE} ${NS_DISTRO} main" | tee /etc/apt/sources.list.d/nodesource-node.list && \ | ||
echo "deb-src https://deb.nodesource.com/${NS_NODE} ${NS_DISTRO} main" | tee -a /etc/apt/sources.list.d/nodesource-node.list && \ | ||
echo "deb https://deb.nodesource.com/${NS_NODE} ${NS_DISTRO} main" | tee /etc/apt/sources.list.d/nsolid.list && \ | ||
echo "deb-src https://deb.nodesource.com/${NS_NODE} ${NS_DISTRO} main" | tee -a /etc/apt/sources.list.d/nsolid.list && \ | ||
apt-get update -qq && \ | ||
apt-get install -yqq nodejs && \ | ||
# configure npm | ||
npm config list > /dev/null 2>&1 && \ | ||
mkdir -p /home/ubuntu/.config && \ | ||
chown -R ubuntu:$(id -gn ubuntu) /home/ubuntu/.config && \ | ||
mkdir -p /home/ubuntu/.npm-global && \ | ||
chown -R ubuntu:$(id -gn ubuntu) /home/ubuntu/.npm-global && \ | ||
npm config --global set prefix /home/ubuntu/.npm-global && \ | ||
# install yarn | ||
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | ||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ | ||
apt-get update -qq && \ | ||
apt-get install -y yarn && \ | ||
# install nsolid | ||
curl -sLf -o /dev/null "http://nsolid-deb.nodesource.com/${NS_NSOLID}/dists/${NS_DISTRO}/Release" && \ | ||
curl -s http://nsolid-deb.nodesource.com/gpgkey/NODESOURCE-NSOLID-GPG-SIGNING-KEY | apt-key add - && \ | ||
echo "deb http://nsolid-deb.nodesource.com/${NS_NSOLID} ${NS_DISTRO} main" | tee /etc/apt/sources.list.d/nodesource-nsolid.list && \ | ||
echo "deb-src http://nsolid-deb.nodesource.com/${NS_NSOLID} ${NS_DISTRO} main" | tee -a /etc/apt/sources.list.d/nodesource-nsolid.list && \ | ||
echo "deb http://nsolid-deb.nodesource.com/${NS_NSOLID} ${NS_DISTRO} main" | tee /etc/apt/sources.list.d/nsolid.list && \ | ||
apt-get update -qq && \ | ||
apt-get install -yqq nsolid-dubnium && \ | ||
# cleanup | ||
apt-get autoclean -yqq && \ | ||
apt-get autoremove -yqq && \ | ||
rm -rf ${USR_SRC_NODE} && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /var/tmp/* | ||
rm -rf /usr/src/* && \ | ||
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \ | ||
rm -rf /var/tmp/* && \ | ||
rm -rf /tmp/* | ||
|
||
WORKDIR /usr/bin | ||
WORKDIR /home/ubuntu | ||
|
||
USER ubuntu | ||
|
||
|
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