code (sha256:3c336969b6a2b2737b7195a005e144644dd9a1653a6fd4a875a8b8802acae541)
Installation
docker pull git.roelc.dev/pixnyb/code@sha256:3c336969b6a2b2737b7195a005e144644dd9a1653a6fd4a875a8b8802acae541sha256:3c336969b6a2b2737b7195a005e144644dd9a1653a6fd4a875a8b8802acae541About this package
A Docker image for running Visual Studio Code with various dependencies.
Image layers
| ARG RELEASE |
| ARG LAUNCHPAD_BUILD_ARCH |
| LABEL org.opencontainers.image.version=24.04 |
| ADD file:c98b7645109cdf61ab97492b90629581b1b7cb925b9d58a5787a4aaeb719f2be in / |
| CMD ["/bin/bash"] |
| LABEL maintainer=Roël Couwenberg <contact@roelc.me> |
| LABEL org.opencontainers.image.title=Dockerised VSCode |
| LABEL org.opencontainers.image.description=A Docker image for running Visual Studio Code with various dependencies. |
| LABEL org.opencontainers.image.url=https://roelc.me/en/resources/2024/05/26/dockerised-vscode |
| LABEL org.opencontainers.image.source=https://github.com/pixnyb/dockerised-vscode |
| RUN /bin/sh -c userdel -r ubuntu || true # buildkit |
| ARG USERNAME=vscode |
| ARG DOCKER=true |
| ARG CODE_INSIDERS |
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV DISPLAY=:0 |
| SHELL [/bin/bash -o pipefail -c] |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils software-properties-common sudo jq gpg gnupg gnome-keyring wget curl ca-certificates locales msmtp-mta bash-completion libdrm2 libgbm1 libnspr4 libnss3 libxkbfile1 xdg-utils libvulkan1 netcat-openbsd net-tools iputils-ping dnsutils git ssh build-essential python3-minimal unzip zip gh glab vim nano tree tmux silversearcher-ag ripgrep less mandoc htop iotop iftop strace nmap tcpdump openbox rxvt-unicode qutebrowser && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8 && dpkg-reconfigure --frontend=noninteractive locales && update-locale LANG=en_US.UTF-8 # buildkit |
| ENV MAILER_DSN=sendmail://default?command=/usr/sbin/sendmail%20-t |
| ENV LANG=en_US.UTF-8 |
| ENV LANGUAGE=en_US:en |
| ENV LC_ALL=en_US.UTF-8 |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && curl -sSL "https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository" | sudo bash # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c cat > /etc/ssh/sshd_config.d/hardened.conf <<EOF PermitRootLogin no PasswordAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no UsePAM yes X11Forwarding yes X11UseLocalhost yes PrintMotd no PrintLastLog no TCPKeepAlive yes PermitUserEnvironment yes ClientAliveInterval 60 ClientAliveCountMax 3 EOF # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c if [ "$DOCKER" = "true" ]; then curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh; fi # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c useradd -m -s /bin/bash ${USERNAME} && echo "${USERNAME} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} && chmod 0440 /etc/sudoers.d/${USERNAME} && usermod -aG docker ${USERNAME} # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg && install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg && echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list && rm -f packages.microsoft.gpg && apt-get install apt-transport-https -y && apt-get update && apt-get install code${CODE_INSIDERS:+-insiders} -y && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c if [ -n "${CODE_INSIDERS}" ]; then ln -s /usr/bin/code-insiders /usr/bin/code; echo "Installed Visual Studio Code Insiders"; fi # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c wget -q -O- https://packagecloud.io/dcommander/turbovnc/gpgkey | gpg --dearmor >/etc/apt/trusted.gpg.d/TurboVNC.gpg && wget -q -O /etc/apt/sources.list.d/turbovnc.list https://raw.githubusercontent.com/TurboVNC/repo/main/TurboVNC.list && apt-get update && apt-get install -y --no-install-recommends turbovnc && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* # buildkit |
| COPY bin/* /usr/local/bin/ # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c chmod +x /usr/local/bin/* # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c mkdir -p /home/${USERNAME}/.vscode${CODE_INSIDERS:+-insiders} /home/${USERNAME}/.vscode-server${CODE_INSIDERS:+-insiders} && chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.vscode${CODE_INSIDERS:+-insiders} /home/${USERNAME}/.vscode-server${CODE_INSIDERS:+-insiders} # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c mkdir -p /etc/home # buildkit |
| RUN |3 USERNAME=vscode DOCKER=true CODE_INSIDERS= /bin/bash -o pipefail -c mkdir -p /home/${USERNAME}/.local/bin && chown -R ${USERNAME}:${USERNAME} /home/${USERNAME} # buildkit |
| USER vscode |
| ENV USER=vscode |
| ENV PATH=/home/vscode/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| COPY .gitignore .gitmessage .gitconfig /home/vscode # buildkit |
| WORKDIR /home/vscode |
| ENTRYPOINT ["/usr/local/bin/start-vscode.sh"] |
| HEALTHCHECK {Test:[CMD /usr/local/bin/healthcheck-vscode.sh] Interval:15s Timeout:5s StartPeriod:15m0s StartInterval:0s Retries:30} |
| EXPOSE [22/tcp 5900/tcp 8000/tcp] |
| USER root |
| RUN /bin/bash -o pipefail -c LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y && apt-get update && apt-get install -y php8.4-dev php8.4-common php8.4-cli php8.4-bcmath php8.4-curl php8.4-mbstring php8.4-mysql php8.4-tokenizer php8.4-xml php8.4-zip php8.4-gd php8.4-intl libapache2-mod-php8.4 apache2 mysql-client && sudo rm -rf /var/lib/apt/lists/* # buildkit |
| RUN /bin/bash -o pipefail -c update-alternatives --set php /usr/bin/php8.4 # buildkit |
| RUN /bin/bash -o pipefail -c pecl channel-update pecl.php.net && pecl install xdebug-3.5.1 && cat > /etc/php/8.4/apache2/conf.d/20-xdebug.ini <<'EOF' error_reporting=E_ALL zend_extension=$(find /usr/lib/php -name xdebug.so) [xdebug] xdebug.remote_enable=1 xdebug.remote_autostart=1 xdebug.remote_connect_back=0 xdebug.remote_host=127.0.0.1 xdebug.remote_port=9003 xdebug.mode=debug xdebug.start_with_request=yes xdebug.client_host=127.0.0.1 xdebug.client_port=9003 xdebug.idekey=VSCODE xdebug.log=/tmp/xdebug.log xdebug.log_level=7 xdebug.max_nesting_level=256 EOF # buildkit |
| RUN /bin/bash -o pipefail -c curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer # buildkit |
| RUN /bin/bash -o pipefail -c echo 'export PATH="$PATH:/home/vscode/.composer/vendor/bin"' >> /home/vscode/.bashrc # buildkit |
| RUN /bin/bash -o pipefail -c sed -i "s|</VirtualHost>| <Directory /var/www/html>\n SetEnvIf X-Forwarded-Proto "https" HTTPS=on\n Options Indexes FollowSymLinks\n AllowOverride All\n Require all granted\n </Directory>\n</VirtualHost>|g" /etc/apache2/sites-available/000-default.conf # buildkit |
| RUN /bin/bash -o pipefail -c sed -i "s|export APACHE_RUN_USER=www-data|export APACHE_RUN_USER=$USER|g" /etc/apache2/envvars # buildkit |
| RUN /bin/bash -o pipefail -c sed -i "s|export APACHE_RUN_GROUP=www-data|export APACHE_RUN_GROUP=$USER|g" /etc/apache2/envvars # buildkit |
| RUN /bin/bash -o pipefail -c a2enmod rewrite && a2enmod headers # buildkit |
| COPY bin/php/* /usr/local/bin # buildkit |
| RUN /bin/bash -o pipefail -c chmod +x /usr/local/bin/* # buildkit |
| COPY templates/php/* /etc/templates # buildkit |
| ENV PHP_VERSION=8.4 |
| ENV WITH_NODE=true |
| RUN /bin/bash -o pipefail -c chmod 777 /var/www/html # buildkit |
| USER vscode |
| RUN /bin/bash -o pipefail -c curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash && echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc && echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> ~/.bashrc && . ~/.nvm/nvm.sh && nvm install node && nvm use node && npm install -g yarn # buildkit |
| ENV PATH=./vendor/bin:./node_modules/.bin:/home/vscode/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| EXPOSE [80/tcp] |
Labels
| Key | Value |
|---|---|
| maintainer | Roël Couwenberg <contact@roelc.me> |
| org.opencontainers.image.description | A Docker image for running Visual Studio Code with various dependencies. |
| org.opencontainers.image.source | https://github.com/pixnyb/dockerised-vscode |
| org.opencontainers.image.title | Dockerised VSCode |
| org.opencontainers.image.url | https://roelc.me/en/resources/2024/05/26/dockerised-vscode |
| org.opencontainers.image.version | 24.04 |
Details
2026-06-01 06:45:38 +02:00
Versions (22)
View all
Container
0
OCI / Docker
linux/arm64
1.1 GiB