Skip to content

Commit

Permalink
Enhancement: Add code-server 4.17.0 variants
Browse files Browse the repository at this point in the history
Signed-off-by: The Oh Brothers Bot <bot@theohbrothers.com>
  • Loading branch information
theohbrothersbot committed Sep 26, 2023
1 parent 3ae7d99 commit 8db8c77
Show file tree
Hide file tree
Showing 12 changed files with 1,202 additions and 9 deletions.
258 changes: 257 additions & 1 deletion .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,260 @@ jobs:
run: |
git diff --exit-code
build-4-17-0:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-4.17.0-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-4.17.0-
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
# Run on master and tags
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}

# This step generates the docker tags
- name: Prepare
id: prep-v4-17-0-alpine-3-15
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="v4.17.0-alpine-3.15"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: v4.17.0-alpine-3.15 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-alpine-3.15
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-alpine-3.15 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-alpine-3.15 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-alpine-3-15.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-v4-17-0-docker-alpine-3-15
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="v4.17.0-docker-alpine-3.15"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: v4.17.0-docker-alpine-3.15 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-alpine-3.15
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-docker-alpine-3.15 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-docker-alpine-3.15 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# This step generates the docker tags
- name: Prepare
id: prep-v4-17-0-docker-rootless-alpine-3-15
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
VARIANT="v4.17.0-docker-rootless-alpine-3.15"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT
echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT
- name: v4.17.0-docker-rootless-alpine-3.15 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: false
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-docker-rootless-alpine-3.15 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: v4.17.0-docker-rootless-alpine-3.15 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
with:
context: variants/v4.17.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-17-0-docker-rootless-alpine-3-15.outputs.REF_SHA_VARIANT }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build-4-16-1:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -141,7 +395,6 @@ jobs:
${{ github.repository }}:${{ steps.prep-v4-16-1-alpine-3-15.outputs.VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-16-1-alpine-3-15.outputs.REF_VARIANT }}
${{ github.repository }}:${{ steps.prep-v4-16-1-alpine-3-15.outputs.REF_SHA_VARIANT }}
${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

Expand Down Expand Up @@ -2953,6 +3206,7 @@ jobs:
update-draft-release:
needs:
- build-4-17-0
- build-4-16-1
- build-4-15-0
- build-4-14-1
Expand All @@ -2977,6 +3231,7 @@ jobs:

publish-draft-release:
needs:
- build-4-17-0
- build-4-16-1
- build-4-15-0
- build-4-14-1
Expand All @@ -3003,6 +3258,7 @@ jobs:

update-dockerhub-description:
needs:
- build-4-17-0
- build-4-16-1
- build-4-15-0
- build-4-14-1
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Dockerized [`code-server`](https://github.com/coder/code-server).

| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:v4.16.1-alpine-3.15`, `:latest` | [View](variants/v4.16.1-alpine-3.15) |
| `:v4.17.0-alpine-3.15`, `:latest` | [View](variants/v4.17.0-alpine-3.15) |
| `:v4.17.0-docker-alpine-3.15` | [View](variants/v4.17.0-docker-alpine-3.15) |
| `:v4.17.0-docker-rootless-alpine-3.15` | [View](variants/v4.17.0-docker-rootless-alpine-3.15) |
| `:v4.16.1-alpine-3.15` | [View](variants/v4.16.1-alpine-3.15) |
| `:v4.16.1-docker-alpine-3.15` | [View](variants/v4.16.1-docker-alpine-3.15) |
| `:v4.16.1-docker-rootless-alpine-3.15` | [View](variants/v4.16.1-docker-rootless-alpine-3.15) |
| `:v4.15.0-alpine-3.15` | [View](variants/v4.15.0-alpine-3.15) |
Expand Down Expand Up @@ -46,7 +49,7 @@ Dockerized [`code-server`](https://github.com/coder/code-server).
| `:v4.6.1-docker-alpine-3.15` | [View](variants/v4.6.1-docker-alpine-3.15) |
| `:v4.6.1-docker-rootless-alpine-3.15` | [View](variants/v4.6.1-docker-rootless-alpine-3.15) |

Base variants include `npm 8` and `nodejs 16` (to run `code-server`), `pwsh`, and basic tools. E.g. `v4.16.1-alpine-3.15`
Base variants include `npm 8` and `nodejs 16` (to run `code-server`), `pwsh`, and basic tools. E.g. `v4.17.0-alpine-3.15`

Incremental variants include additional tools and their `code` extensions:

Expand All @@ -59,29 +62,29 @@ Incremental variants include additional tools and their `code` extensions:
### Base variant(s)

```sh
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-alpine-3.15
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-alpine-3.15
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file: --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'
```

To disable password authentication, use `--auth=none`:

```sh
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
```

### `docker` variant(s)

```sh
docker run --name code-server --rm -it --privileged -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-docker-alpine-3.15
docker run --name code-server --rm -it --privileged -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-docker-alpine-3.15
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file:
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'
```

To disable password authentication, use `--auth=none`:

```sh
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-docker-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-docker-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
```

#### docker buildx
Expand Down Expand Up @@ -109,15 +112,15 @@ docker buildx build ...
### `docker-rootless` variant(s)

```sh
docker run --name code-server --rm -it --privileged -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-docker-rootless-alpine-3.15
docker run --name code-server --rm -it --privileged -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-docker-rootless-alpine-3.15
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file:
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'
```

To start code-server without password authentication, use `--auth=none`:

```sh
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.16.1-docker-rootless-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:v4.17.0-docker-rootless-alpine-3.15 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check
```

To build multi-arch images using `docker buildx`, see [here](#docker-buildx).
Expand Down
1 change: 1 addition & 0 deletions generate/definitions/versions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"code-server": {
"versions": [
"4.17.0",
"4.16.1",
"4.15.0",
"4.14.1",
Expand Down
Loading

0 comments on commit 8db8c77

Please sign in to comment.