Skip to content

Multi-arch, install via npm #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2020
Merged
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
34 changes: 25 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,44 @@ LABEL maintainer="aptalca"
ENV HOME="/config"

RUN \
echo "**** install dependencies ****" && \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
CODE_URL=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/tags/${CODE_RELEASE}" \
| jq -r '.assets[] | select(.browser_download_url | contains("linux-x86_64")) | .browser_download_url') && \
mkdir -p /app/code-server && \
curl -o \
/tmp/code.tar.gz -L \
"${CODE_URL}" && \
tar xzf /tmp/code.tar.gz -C \
/app/code-server --strip-components=1 && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
Expand Down
61 changes: 61 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM lsiobase/ubuntu:arm64v8-bionic

# 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
ENV HOME="/config"

RUN \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

# add local files
COPY /root /

# ports and volumes
EXPOSE 8443
61 changes: 61 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM lsiobase/ubuntu:arm32v7-bionic

# 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
ENV HOME="/config"

RUN \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm install --unsafe-perm -g code-server@"$CODE_VERSION" && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

# add local files
COPY /root /

# ports and volumes
EXPOSE 8443
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
DEV_DOCKERHUB_IMAGE = 'lsiodev/code-server'
PR_DOCKERHUB_IMAGE = 'lspipepr/code-server'
DIST_IMAGE = 'ubuntu'
MULTIARCH='false'
MULTIARCH='true'
CI='true'
CI_WEB='true'
CI_PORT='8443'
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ The architectures supported by this image are:
| Architecture | Tag |
| :----: | --- |
| x86-64 | amd64-latest |
| arm64 | arm64v8-latest |
| armhf | arm32v7-latest |

## Version Tags

Expand Down Expand Up @@ -234,6 +236,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **18.05.20:** - Switch to multi-arch images, install via npm.
* **29.04.20:** - Update start arguments.
* **01.04.20:** - Structural changes required for v3.
* **17.01.20:** - Fix artifact url retrieval from github.
Expand Down
2 changes: 1 addition & 1 deletion jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repo_vars:
- DEV_DOCKERHUB_IMAGE = 'lsiodev/code-server'
- PR_DOCKERHUB_IMAGE = 'lspipepr/code-server'
- DIST_IMAGE = 'ubuntu'
- MULTIARCH='false'
- MULTIARCH='true'
- CI='true'
- CI_WEB='true'
- CI_PORT='8443'
Expand Down
3 changes: 3 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_
# supported architectures
available_architectures:
- { arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
- { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
- { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"}

# development version
development_versions: true
Expand Down Expand Up @@ -65,6 +67,7 @@ app_setup_block: |

# changelog
changelogs:
- { date: "18.05.20:", desc: "Switch to multi-arch images, install via npm." }
- { date: "29.04.20:", desc: "Update start arguments." }
- { date: "01.04.20:", desc: "Structural changes required for v3." }
- { date: "17.01.20:", desc: "Fix artifact url retrieval from github." }
Expand Down
3 changes: 1 addition & 2 deletions root/etc/services.d/code-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ fi

exec \
s6-setuidgid abc \
/app/code-server/code-server \
/usr/bin/code-server \
--bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \
--extensions-dir /config/extensions \
--disable-telemetry \
--disable-updates \
--auth "${AUTH}" \
/config/workspace