forked from espnet/espnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathespnet3.dockerfile
More file actions
30 lines (27 loc) · 1.06 KB
/
espnet3.dockerfile
File metadata and controls
30 lines (27 loc) · 1.06 KB
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
ARG FROM_TAG=dev3-cpu
FROM espnet/espnet:${FROM_TAG}
ENV DEBIAN_FRONTEND=noninteractive
ARG USERNAME=user
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN if [ -z "$(getent group ${GROUP_ID})" ]; then \
groupadd -g ${GROUP_ID} "${USERNAME}"; \
else \
existing_group="$(getent group $GROUP_ID | cut -d: -f1)"; \
if [ "${existing_group}" != "${USERNAME}" ]; then \
groupmod -n "${USERNAME}" "${existing_group}"; \
fi; \
fi && \
if [ -z "$(getent passwd $USER_ID)" ]; then \
useradd -m -u ${USER_ID} -g ${GROUP_ID} "${USERNAME}"; \
else \
existing_user="$(getent passwd ${USER_ID} | cut -d: -f1)"; \
if [ "${existing_user}" != "${USERNAME}" ]; then \
usermod -l "${USERNAME}" -d /home/"${USERNAME}" -m "${existing_user}"; \
fi; \
fi && \
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/g' /home/${USERNAME}/.bashrc && \
chown -R ${USERNAME}:${USERNAME} /workspaces
USER ${USERNAME}
WORKDIR /workspaces