File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- ARG UBUNTU_VERSION
2- FROM mcr.microsoft.com/devcontainers/base: ubuntu- ${UBUNTU_VERSION}
1+ ARG UBUNTU_VERSION=22.04
2+ FROM ubuntu: ${UBUNTU_VERSION}
33
4- USER root
4+ # Avoid interactive prompts during package installation
5+ ENV DEBIAN_FRONTEND=noninteractive
56
7+ # Install packages as root
68RUN apt-get update && apt-get install -y \
79 build-essential \
810 wget \
@@ -13,6 +15,23 @@ RUN apt-get update && apt-get install -y \
1315 ca-certificates \
1416 lsb-release \
1517 apt-transport-https \
16- telnet
18+ telnet \
19+ sudo \
20+ git \
21+ && rm -rf /var/lib/apt/lists/*
1722
23+ # Create vscode user with same setup as devcontainer
24+ ARG USERNAME=vscode
25+ ARG USER_UID=1000
26+ ARG USER_GID=1000
27+
28+ RUN groupadd --gid ${USER_GID} ${USERNAME} \
29+ && useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} -s /bin/bash \
30+ && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \
31+ && chmod 0440 /etc/sudoers.d/${USERNAME}
32+
33+ # Switch to vscode user
1834USER vscode
35+ WORKDIR /home/vscode
36+
37+ ENV DEBIAN_FRONTEND=dialog
You can’t perform that action at this time.
0 commit comments