-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (26 loc) · 1.16 KB
/
Dockerfile
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
33
34
35
36
37
38
FROM dockershelf/node:16
LABEL maintainer "Luis Alejandro Martínez Faneyth <[email protected]>"
ARG UID=1000
ARG GID=1000
RUN apt-get update && \
apt-get install gnupg dirmngr sudo
RUN gpg --lock-never --no-default-keyring \
--keyring /usr/share/keyrings/yarn.gpg \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 23E7166788B63E1E
RUN echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && \
apt-get install yarn
RUN EXISTUSER=$(getent passwd | awk -F':' '$3 == '$UID' {print $1}') && \
[ -n "${EXISTUSER}" ] && deluser ${EXISTUSER} || true
RUN EXISTGROUP=$(getent group | awk -F':' '$3 == '$GID' {print $1}') && \
[ -n "${EXISTGROUP}" ] && delgroup ${EXISTGROUP} || true
RUN groupadd -g "${GID}" luisalejandro || true
RUN useradd -u "${UID}" -g "${GID}" -ms /bin/bash luisalejandro
RUN echo "luisalejandro ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/luisalejandro
USER luisalejandro
RUN mkdir -p \
/home/luisalejandro/app \
/home/luisalejandro/.cache/yarn
WORKDIR /home/luisalejandro/app
CMD tail -f /dev/null