Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit c41e680

Browse files
committed
feat: initial project
1 parent 9905746 commit c41e680

File tree

9 files changed

+193
-2
lines changed

9 files changed

+193
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
DRY_RUN: ${{ github.ref_name != 'main' }}
16+
OWNER: ${{ github.repository_owner }}
17+
PLATFORMS: linux/amd64
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
id-token: write
27+
packages: write
28+
29+
steps:
30+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
32+
- uses: sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
33+
34+
- name: Docker registry login
35+
if: env.DRY_RUN == 'false'
36+
run: |
37+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ env.OWNER }} --password-stdin
38+
39+
- name: Publish to ghcr.io
40+
uses: containerbase/internal-tools@cce4ed496d2180a0ea727e82ec3e838c68d107b0 # v3.0.18
41+
with:
42+
command: docker-builder
43+
image-prefix: ghcr.io/${{ env.OWNER }}
44+
platforms: ${{ env.PLATFORMS }
45+
last-only: true
46+
major-minor: false
47+
dry-run: ${{ env.DRY_RUN }}
48+
49+
release:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: write
54+
55+
steps:
56+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
57+
58+
- name: Init
59+
run: ./bin/init.sh
60+
61+
- uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
62+
if: env.DRY_RUN == 'false'
63+
with:
64+
allowUpdates: true
65+
body: See https://github.com/containerbase/base/releases/tag/${{ env.VERSION }} for more changes
66+
commit: ${{ github.sha }}
67+
name: ${{ env.VERSION }}
68+
tag: v${{ env.VERSION }}
69+
token: ${{ secrets.GITHUB_TOKEN }}

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

Dockerfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# renovate: datasource=docker depName=ghcr.io/containerbase/base
2+
ARG CONTAINERBASE_VERSION=9.26.0
3+
4+
FROM ghcr.io/containerbase/base:${CONTAINERBASE_VERSION} as containerbase
5+
6+
FROM amd64/ubuntu:jammy as base
7+
8+
ARG CONTAINERBASE_VERSION
9+
ARG APT_HTTP_PROXY
10+
11+
LABEL org.opencontainers.image.source="https://github.com/containerbase/gitpod" \
12+
org.opencontainers.image.version="${CONTAINERBASE_VERSION}"
13+
14+
# Compatibillity
15+
LABEL org.label-schema.vcs-url="https://github.com/containerbase/gitpod" \
16+
org.label-schema.version="${CONTAINERBASE_VERSION}"
17+
18+
ARG USER_NAME=gitpod
19+
ARG USER_ID=33333
20+
ARG PRIMARY_GROUP_ID=33333
21+
22+
# Set env and shell
23+
ENV BASH_ENV=/usr/local/etc/env ENV=/usr/local/etc/env PATH=/home/$USER_NAME/bin:$PATH
24+
SHELL ["/bin/bash" , "-c"]
25+
26+
# This entry point ensures that dumb-init is run
27+
ENTRYPOINT [ "docker-entrypoint.sh" ]
28+
29+
# Set up containerbase
30+
COPY --from=containerbase /usr/local/bin/ /usr/local/bin/
31+
COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/
32+
RUN install-containerbase
33+
34+
# add required gitpod packages
35+
RUN set -ex; \
36+
install-apt make shellcheck sudo locales; \
37+
locale-gen en_US.UTF-8; \
38+
true
39+
40+
# allow sudo without password
41+
RUN echo "gitpod ALL=NOPASSWD:ALL" > /etc/sudoers.d/gitpod; sudo id
42+
43+
# renovate: datasource=github-tags packageName=git/git
44+
RUN install-tool git v2.30.0
45+
46+
# mark all directories as safe
47+
RUN git config --system --add safe.directory '*'
48+
49+
# renovate: datasource=github-releases depName=docker lookupName=moby/moby
50+
RUN install-tool docker 20.10.7
51+
52+
# renovate: datasource=docker versioning=docker
53+
RUN install-tool node 20.10.0
54+
55+
# renovate: datasource=npm
56+
RUN install-tool corepack 0.23.0
57+
58+
# prepare some tools for gitpod
59+
RUN prepare-tool python
60+
61+
USER gitpod

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
# gitpod
2-
Gitpod base image
1+
# containerbase gitpod
2+
3+
[![Build status](https://github.com/containerbase/gitpod/actions/workflows/build.yml/badge.svg)](https://github.com/containerbase/gitpod/actions/workflows/build.yml?query=branch%3Amain)
4+
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/containerbase/gitpod)
5+
![License: MIT](https://img.shields.io/github/license/containerbase/gitpod)
6+
7+
A docker base image for Gitpod usage.
8+
9+
This repository is the source for the Github container registry image [`ghcr.io/containerbase/gitpod`](https://github.com/containerbase/gitpod/pkgs/container/gitpod).
10+
Commits to `main` branch are automatically build and published.

bin/init.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
FROM=$(grep 'CONTAINERBASE_VERSION' Dockerfile)
6+
SEMVER_REGEX="=v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[a-z0-9]+)?"
7+
8+
9+
if ! [[ "$FROM" =~ $SEMVER_REGEX ]]; then
10+
echo Not a semver tag - skipping
11+
exit 1
12+
fi
13+
14+
major=${BASH_REMATCH[1]}
15+
minor=${BASH_REMATCH[2]}
16+
patch=${BASH_REMATCH[3]}
17+
18+
19+
VERSION="${major}.${minor}.${patch}"
20+
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
21+
echo "Found version: ${VERSION}"

builder.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"image": "gitpod",
3+
"versioning": "semver",
4+
"startVersion": "9.25.0",
5+
"cache": "docker-build-cache",
6+
"buildArg": "CONTAINERBASE_VERSION"
7+
}

renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["local>containerbase/.github"],
4+
"packageRules": [
5+
{
6+
"matchManagers": ["dockerfile"],
7+
"enabled": false
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)