Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
S3_ACCESS_KEY_ID=XXXXXXXXXX
S3_SECRET_ACCESS_KEY=Xxxxxxxxxxxxxxxxxxxxxxxxxx
S3_BUCKET=code-server
S3_ENDPOINT=xxxxxx
S3_REGION=us-southeast-1
GIT_USER_NAME=git
GIT_USER_EMAIL=git@localhost
TOKEN_NGROK=xxxxxxx
EXTENSIONS_RUNTIME=Vue.volar Vue.vscode-typescript-vue-plugin dbaeumer.vscode-eslint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ Network Trash Folder
Temporary Items
.apdisk
.jenkins-external
.env
73 changes: 39 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy

# set version label
# Set version label
ARG BUILD_DATE
ARG VERSION
ARG CODE_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"

# environment settings
# Environment settings
ARG DEBIAN_FRONTEND="noninteractive"
ENV HOME="/config"
ENV HOME="/config"

RUN \
echo "**** install runtime dependencies ****" && \
apt-get update && \
apt-get install -y \
git \
jq \
libatomic1 \
nano \
net-tools \
netcat \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code-server.tar.gz -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" && \
tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Install dependencies and clean up in a single RUN command
RUN apt-get update && apt-get install -y \
git openssh-client jq libatomic1 nano net-tools netcat sudo \
ca-certificates curl gnupg s3fs \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g yarn \
&& npx playwright install-deps \
&& npx playwright install webkit chromium \
&& if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi \
&& mkdir -p /app/code-server \
&& curl -o /tmp/code-server.tar.gz -L "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" \
&& tar xf /tmp/code-server.tar.gz -C /app/code-server --strip-components=1 \
&& curl -o /tmp/ngrok.tgz -L "https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz" \
&& tar zxvf /tmp/ngrok.tgz -C /app \
&& curl -LO https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb \
&& dpkg -i cloudflared-linux-amd64.deb \
&& mkdir -p /temp/extensions \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension ms-azuretools.vscode-docker \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension IronGeek.vscode-env \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension esbenp.prettier-vscode \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension redhat.vscode-yaml \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension nick-rudenko.back-n-forth \
&& /app/code-server/bin/code-server --extensions-dir /temp/extensions --install-extension humao.rest-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* "${HOME:?}"/*

# add local files
# Add local files
COPY /root /

# ports and volumes
# Expose port
EXPOSE 8443
2 changes: 1 addition & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
/config/* \
"${HOME:?}"/* \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
Expand Down
4 changes: 4 additions & 0 deletions PUSH_DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Push image to the Docker registry
docker build -t erikvargas/code-server .
docker login -u erikvargas
docker push erikvargas/code-server
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e DEFAULT_WORKSPACE=/config/workspace` | If this optional variable is set, code-server will open this directory by default |
| `-v /config` | Contains all relevant configuration files. |

The container uses `HOME=/config` by default for code-server data, extensions, workspace files, and shell configuration. If overriding `HOME` with `-e HOME=/some/path`, use an absolute path inside the container and mount persistent storage at that same path.

## Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend `FILE__`.
Expand Down
Loading