Skip to content
Open
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
20 changes: 13 additions & 7 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
echo "date=$(date --rfc-3339=seconds | sed 's/ /T/')" >> $GITHUB_OUTPUT

version:
name: Get latest package version
name: Determine package version and image tag
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.version.outputs.package_version }}
image_tag: ${{ steps.version.outputs.image_tag }}
steps:
- name: Add Microsoft's APT repo for VS Code
run: |
Expand All @@ -36,12 +37,16 @@ jobs:
| sudo tee -a /etc/apt/sources.list.d/microsoft.list
sudo apt-get update -y

- name: Get package version
- name: Get package version and set image tag
id: version
run: |
package_version=$(apt list code 2>/dev/null | grep -v "^Listing" | awk '{print $2}' | cut -d'-' -f1)
echo "package_version=${package_version}" >> $GITHUB_OUTPUT
echo "The package version is $package_version"
package_version=$(apt-cache policy code | awk -F': ' '/Candidate:/ {print $2}')
[ -n "$package_version" ] || { echo "Failed to determine VS Code package version" >&2; exit 1; }
image_tag=$(echo "$package_version" | cut -d'-' -f1)
echo "package_version=$package_version" >> $GITHUB_OUTPUT
echo "image_tag=$image_tag" >> $GITHUB_OUTPUT
echo "Package Version: $package_version"
echo "Image Tag: $image_tag"

build:
name: Build and push image
Expand Down Expand Up @@ -79,11 +84,12 @@ jobs:
push: true
build-args: |
IMAGE_BUILD_DATE=${{ needs.date.outputs.date }}
INSTALL_VERSION=${{ needs.version.outputs.package_version }}
tags: |
ghcr.io/${{ github.repository_owner }}/code-tunnel:latest
ghcr.io/${{ github.repository_owner }}/code-tunnel:${{ needs.version.outputs.package_version }}
ghcr.io/${{ github.repository_owner }}/code-tunnel:${{ needs.version.outputs.image_tag }}
${{ vars.DOCKERHUB_USERNAME }}/code-tunnel:latest
${{ vars.DOCKERHUB_USERNAME }}/code-tunnel:${{ needs.version.outputs.package_version }}
${{ vars.DOCKERHUB_USERNAME }}/code-tunnel:${{ needs.version.outputs.image_tag }}
labels: |
org.opencontainers.image.ref.name=${{ github.ref }}
org.opencontainers.image.revision=${{ github.sha }}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM ghcr.io/linuxserver/baseimage-ubuntu:noble

# set labels
ARG IMAGE_BUILD_DATE
ARG INSTALL_VERSION
LABEL release_channel="stable"
LABEL org.opencontainers.image.authors="tibynx"
LABEL org.opencontainers.image.created="${IMAGE_BUILD_DATE}"
Expand Down Expand Up @@ -48,7 +49,7 @@ RUN \
https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list && \
apt-get update -y && \
apt-get install --no-install-recommends -y \
code && \
code=${INSTALL_VERSION} && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble

# set labels
ARG IMAGE_BUILD_DATE
ARG INSTALL_VERSION
LABEL release_channel="stable"
LABEL org.opencontainers.image.authors="tibynx"
LABEL org.opencontainers.image.created="${IMAGE_BUILD_DATE}"
Expand Down Expand Up @@ -48,7 +49,7 @@ RUN \
https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list && \
apt-get update -y && \
apt-get install --no-install-recommends -y \
code && \
code=${INSTALL_VERSION} && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \
Expand Down