Skip to content

Commit fea4258

Browse files
committed
fix: dockerfile for multiplatform support
1 parent 0b0918b commit fea4258

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

dockerfiles/ubuntu/Dockerfile

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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
68
RUN 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
1834
USER vscode
35+
WORKDIR /home/vscode
36+
37+
ENV DEBIAN_FRONTEND=dialog

0 commit comments

Comments
 (0)