forked from olbat/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (27 loc) · 869 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (27 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG MAINTAINER
FROM debian:stable-slim
MAINTAINER $MAINTAINER
ARG NODE_VERSION=16
# Install Packages (basic and NodeJS development tools from upstream repository)
RUN apt-get update \
&& apt-get install -y curl gnupg \
&& curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -\
&& echo "deb http://deb.nodesource.com/node_${NODE_VERSION}.x bullseye main" \
> /etc/apt/sources.list.d/nodejs.list \
&& apt-get update \
&& apt-get install -y sudo git nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Add node user and disable sudo password checking
RUN useradd \
--groups=sudo \
--create-home \
--home-dir=/home/node \
--shell=/bin/bash \
node \
&& sed -i '/%sudo[[:space:]]/ s/ALL[[:space:]]*$/NOPASSWD:ALL/' /etc/sudoers
# Setup environment
USER node
WORKDIR /home/node
# Default shell
CMD ["/bin/bash","--login","-i"]