Skip to content

Commit 3a97611

Browse files
Merge branch 'force-command' of https://github.com/giuliafalaschi/liqo into force-command
2 parents f38e1da + e382dd0 commit 3a97611

File tree

67 files changed

+1613
-646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1613
-646
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# syntax=docker/dockerfile:1
2+
FROM mcr.microsoft.com/devcontainers/go:1-1.24-bookworm
3+
4+
# Install kubectl
5+
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
6+
&& install -m 0755 kubectl /usr/local/bin/kubectl \
7+
&& rm kubectl
8+
9+
# Install Helm
10+
RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

.devcontainer/Readme.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# DevContainer
2+
3+
A devcontainer (short for "development container", https://containers.dev/) is a pre-configured, isolated environment defined by configuration files (like devcontainer.json and Dockerfiles) that sets up all the tools, dependencies, and settings needed for a project.
4+
It allows developers to work in a consistent environment, regardless of their local setup, often using Visual Studio Code's "Remote - Containers" feature (https://code.visualstudio.com/docs/devcontainers/containers).
5+
This helps avoid "it works on my machine" issues and simplifies onboarding for new contributors.
6+
7+
## Main Features
8+
9+
- **Go Development**: Includes Go and common Go utilities pre-installed and available on the `PATH`, along with the Go language extension for enhanced Go development.
10+
- **Up-to-date Git**: Ships with an up-to-date version of Git, built from source if needed, and available on the `PATH`.
11+
- **Docker CLI**: The Docker CLI (`docker`) and Docker Compose v2 are pre-installed, allowing container management using the **host's Docker daemon**.
12+
- **GitHub CLI**: The latest GitHub CLI (`gh`) is installed and available on the `PATH`.
13+
- **Kubernetes in Docker (KinD)**: Includes KinD for running local Kubernetes clusters, supporting Kubernetes-native development and testing.
14+
- **Enhanced Shell Experience**: Zsh is set as the default shell, with Oh My Zsh, Powerlevel10k theme, and a curated set of plugins (e.g., autosuggestions, syntax highlighting, kubectl, docker, git, golang, helm).
15+
- **Host Home Directory Mount**: Mounts the host's home directory as read-only at `/mnt/hosthome` for easy access to configuration files and credentials.
16+
- **Automatic Powerlevel10k Setup**: If a `.p10k.zsh` config is found in the host's home, it is copied and sourced automatically in the container.
17+
- **Automatic Package Upgrades**: System packages are upgraded on container creation, including support for non-free packages.
18+
- **Network Capabilities**: This devcontainer setup allows to carry out networking actions, such as creating Linux network namespaces and new network interfaces.
19+
20+
## Behaviours
21+
22+
- On container start, the Powerlevel10k theme is installed and configured if a `.p10k.zsh` file is present.
23+
- Zsh plugins and Oh My Zsh plugins are installed for the `vscode` user.

.devcontainer/devcontainer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "Go",
3+
"dockerFile": "Dockerfile",
4+
"runArgs": [
5+
"--privileged",
6+
"--cap-add=NET_ADMIN",
7+
"--cap-add=NET_RAW",
8+
"--network=host"
9+
],
10+
"features": {
11+
"ghcr.io/devcontainers/features/common-utils:2": {
12+
"installZsh": true,
13+
"configureZshAsDefaultShell": true,
14+
"installOhMyZsh": true,
15+
"installOhMyZshConfig": true,
16+
"upgradePackages": true,
17+
"nonFreePackages": true,
18+
"username": "automatic",
19+
"userUid": "automatic",
20+
"userGid": "automatic"
21+
},
22+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
23+
"version": "latest",
24+
"dockerDashComposeVersion": "v2"
25+
},
26+
"ghcr.io/devcontainers/features/github-cli:1": {
27+
"installDirectlyFromGitHubRelease": true,
28+
"version": "latest"
29+
},
30+
"ghcr.io/devcontainers-extra/features/kind:1": {
31+
"version": "latest"
32+
},
33+
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
34+
"plugins": "zsh-autosuggestions zsh-syntax-highlighting kubectl docker docker-compose git-auto-fetch git-commit golang helm",
35+
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting",
36+
"username": "vscode"
37+
}
38+
},
39+
"mounts": [
40+
"source=${env:HOME},target=/mnt/hosthome,type=bind,consistency=cached,readonly"
41+
],
42+
"postStartCommand": "if [ -f /mnt/hosthome/.p10k.zsh ]; then cp /mnt/hosthome/.p10k.zsh /home/vscode/.p10k.zsh; fi && git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/vscode/.oh-my-zsh/custom/themes/powerlevel10k && sed -i 's|^ZSH_THEME=.*|ZSH_THEME=\\\"powerlevel10k/powerlevel10k\\\"|' /home/vscode/.zshrc && echo '\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> /home/vscode/.zshrc && docker buildx create --name liqo-builder --use --driver-opt network=host"
43+
}

.github/workflows/check-generated-artifacts.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
- name: Setup Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: '1.24'
23+
go-version-file: go.mod
24+
cache: true
25+
cache-dependency-path: go.sum
2426

2527
- name: Run the automatic generation
2628
working-directory: ./

.github/workflows/codeql.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ jobs:
7474

7575
- uses: actions/setup-go@v5
7676
with:
77-
go-version: '1.24'
77+
go-version-file: go.mod
78+
cache: true
79+
cache-dependency-path: go.sum
7880

7981
# Initializes the CodeQL tools for scanning.
8082
- name: Initialize CodeQL

0 commit comments

Comments
 (0)