Skip to content
Draft
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
27 changes: 27 additions & 0 deletions apps/vscode-tunnel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/trueforge-org/ubuntu:24.04
ARG TARGETARCH

# TODO automate grabbing version here: https://update.code.visualstudio.com/api/releases/stable
ARG VERSION

USER root

RUN apt-get update && \
apt-get install -y git && \
curl -sL "https://update.code.visualstudio.com/${VERSION}/linux-${TARGETARCH}/stable" \
--output /tmp/vscode-cli.tar.gz && \
tar -xf /tmp/vscode-cli.tar.gz -C /usr/bin && \
rm /tmp/vscode-cli.tar.gz; \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

USER apps


USER nobody:nogroup

CMD [ "code", "tunnel", "--accept-server-license-terms" ]

WORKDIR /config
33 changes: 33 additions & 0 deletions apps/vscode-tunnel/container_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"context"
"os"
"testing"

"github.com/stretchr/testify/require"

"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
)

func Test(t *testing.T) {
ctx := context.Background()

appName := os.Getenv("APP")
require.NotEmpty(t, appName, "APP environment variable must be set")
image := os.Getenv("TEST_IMAGE")
if image == "" {
image = "ghcr.io/trueforge-org/" + appName + ":rolling"
}

app, err := testcontainers.Run(
ctx, image,
testcontainers.WithExposedPorts("8080/tcp"),
testcontainers.WithWaitStrategy(
wait.ForListeningPort("8080/tcp"),
),
)
testcontainers.CleanupContainer(t, app)
require.NoError(t, err)
}
47 changes: 47 additions & 0 deletions apps/vscode-tunnel/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
target "docker-metadata-action" {}

variable "APP" {
default = "vscode-tunnel"
}

variable "VERSION" {
// renovate: datasource=github-releases depName=Jackett/Jackett
default = "1.104.3"
}

variable "LICENSE" {
default = "AGPL-3.0-or-later"
}

variable "SOURCE" {
default = "https://code.visualstudio.com"
}

group "default" {
targets = ["image-local"]
}

target "image" {
inherits = ["docker-metadata-action"]
args = {
VERSION = "${VERSION}"
}
labels = {
"org.opencontainers.image.source" = "${SOURCE}"
"org.opencontainers.image.licenses" = "${LICENSE}"
}
}

target "image-local" {
inherits = ["image"]
output = ["type=docker"]
tags = ["${APP}:${VERSION}"]
}

target "image-all" {
inherits = ["image"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}
Loading