mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2026-07-04 14:30:54 -06:00
The apt repo at packages.microsoft.com/repos/vscode does not publish amd64
and arm64 .deb packages atomically, so the arm64 build in CI could pick up
an older VS Code version than amd64 when both platforms build in the same run.
Switch to downloading the .deb directly from
update.code.visualstudio.com/latest/linux-deb-{arch}/stable, the canonical
"always latest" endpoint, and resolve dependencies via apt-get install -f.
Also add an explicit docker/setup-qemu-action step to the workflow so arm64
emulation is version-pinned rather than relying on the runner's default
binfmt registration.
55 lines
1.8 KiB
Docker
55 lines
1.8 KiB
Docker
FROM ubuntu:22.04
|
|
|
|
# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
|
|
RUN apt update && apt install -y sudo
|
|
|
|
RUN sudo apt-get update
|
|
#Instalando Curl
|
|
RUN sudo apt-get install -y curl
|
|
#Instalando wget
|
|
RUN sudo apt-get install -y wget
|
|
#Instalando jq
|
|
RUN sudo apt-get install -y jq
|
|
|
|
RUN sudo apt-get update
|
|
RUN sudo apt-get install -y dumb-init
|
|
|
|
RUN ARCH="$(dpkg --print-architecture)" \
|
|
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-${ARCH}.tar.gz" | tar -C /usr/local/bin -xzf - \
|
|
&& chown root:root /usr/local/bin/fixuid \
|
|
&& chmod 4755 /usr/local/bin/fixuid \
|
|
&& mkdir -p /etc/fixuid \
|
|
&& printf "user: vscode\ngroup: vscode\n" > /etc/fixuid/config.yml
|
|
|
|
#Instalando devtunnel
|
|
#Comandos que no se deben olvidar correr al crear el devtunnel
|
|
#devtunnel user login -g -d
|
|
#devtunnel token TUNNELID --scope connect
|
|
RUN curl -sL https://aka.ms/DevTunnelCliInstall | bash
|
|
|
|
#Instalando VSCode
|
|
RUN ARCH="$(dpkg --print-architecture)" \
|
|
&& case "${ARCH}" in \
|
|
amd64) VSCODE_ARCH="x64" ;; \
|
|
arm64) VSCODE_ARCH="arm64" ;; \
|
|
*) echo "Unsupported architecture: ${ARCH}" >&2; exit 1 ;; \
|
|
esac \
|
|
&& curl -fsSL "https://update.code.visualstudio.com/latest/linux-deb-${VSCODE_ARCH}/stable" -o /tmp/vscode.deb \
|
|
&& (sudo dpkg -i /tmp/vscode.deb || true) \
|
|
&& sudo apt-get update \
|
|
&& sudo DEBIAN_FRONTEND=noninteractive apt-get install -f -y \
|
|
&& rm -f /tmp/vscode.deb
|
|
|
|
#Making home writable
|
|
RUN sudo chmod -R a+rwX /home
|
|
|
|
RUN sudo sysctl -w fs.inotify.max_user_watches=524288
|
|
|
|
ADD ./.bashrc /usr/bin/.bashrc
|
|
RUN sudo chmod +x /usr/bin/.bashrc
|
|
ADD ./.profile /usr/bin/.profile
|
|
RUN sudo chmod +x /usr/bin/.profile
|
|
ADD ./entrypoint.sh /usr/bin/entrypoint.sh
|
|
RUN sudo chmod +x /usr/bin/entrypoint.sh
|
|
|
|
ENTRYPOINT ["/usr/bin/entrypoint.sh"] |