Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dev container #2

Merged
merged 29 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1880146
feat: dev ci
npv2k1 Feb 2, 2024
da5f924
update
npv2k1 Feb 2, 2024
b78a02e
update
npv2k1 Feb 2, 2024
ea56194
update
npv2k1 Feb 2, 2024
6e556ae
update
npv2k1 Feb 2, 2024
ca8d72b
update
npv2k1 Feb 2, 2024
34043ed
template
npv2k1 Feb 2, 2024
239d86b
update
npv2k1 Feb 2, 2024
da6c735
update
npv2k1 Feb 2, 2024
f80d3dd
update
npv2k1 Feb 2, 2024
e53f09b
up
npv2k1 Feb 2, 2024
c51a479
update
npv2k1 Feb 2, 2024
41e7aa7
feat: Add step to list directories in test-dev-container workflow
npv2k1 Feb 2, 2024
40cd8dd
Merge branch 'master' into develop
npv2k1 Feb 3, 2024
8c6f58a
Update build-dev-container.yaml to include develop branch in push event
npv2k1 Feb 3, 2024
042f4f8
Update build-dev-container.yaml with cacheFrom option
npv2k1 Feb 3, 2024
3a88049
Remove test-dev-container workflow
npv2k1 Feb 3, 2024
a053360
Add Dockerfile and devcontainer.json for universal template
npv2k1 Feb 3, 2024
fa73d51
Add Dockerfile and devcontainer.json for Ubuntu development environment
npv2k1 Feb 3, 2024
8d3c6bf
Update devcontainer.json with base image
npv2k1 Feb 3, 2024
ff04c1a
Add fail-fast option to matrix strategy
npv2k1 Feb 3, 2024
d68a556
Add fail-fast strategy to build-dev-container workflow
npv2k1 Feb 3, 2024
b334451
Update fail-fast strategy in build-dev-container.yaml
npv2k1 Feb 3, 2024
3429892
Add QEMU and Docker Buildx setup actions
npv2k1 Feb 3, 2024
855dd42
Add workspace directory and hello.txt file
npv2k1 Feb 3, 2024
0be19e9
Add neovim-apt-get feature to devcontainer.json
npv2k1 Feb 3, 2024
d6df276
Add local feature for Ubuntu development container
npv2k1 Feb 3, 2024
e422a6f
Update agnoster theme installation command
npv2k1 Feb 3, 2024
ee2c780
Add neovim-apt-get and vscode-server to devcontainer.json
npv2k1 Feb 4, 2024
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
15 changes: 12 additions & 3 deletions .github/workflows/build-dev-container.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: 'Build dev container'

on:
pull_request:
push:
branches:
- master
- develop

jobs:
list-dir:
Expand All @@ -27,11 +27,18 @@ jobs:
runs-on: ubuntu-latest
needs: [list-dir]
strategy:
fail-fast: false
matrix:
dir: ${{fromJson(needs.list-dir.outputs.dir)}}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -44,5 +51,7 @@ jobs:
uses: devcontainers/ci@v0.3
with:
subFolder: ./templates/${{ matrix.dir }}
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest
imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
push: always
6 changes: 6 additions & 0 deletions templates/ubuntu-dev/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/devcontainers/base:jammy

RUN mkdir /workspace

RUN echo "Hello, World!" >> /workspace/hello.txt

62 changes: 62 additions & 0 deletions templates/ubuntu-dev/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/common-utils": {},

"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/tailscale/codespace/tailscale": {},
"ghcr.io/devcontainers/features/rust:1": {},
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/devcontainers/features/git-lfs:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest"
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "latest"
},
"./local-features/ubuntu-dev": "latest"
},
"runArgs": ["--device=/dev/net/tun"]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "ubuntu-dev",
"id": "ubuntu-dev",
"version": "1.0.3",
"description": "Setup android sdk in your development container",
"documentationURL": "https://github.com/pnstack/codespace",
"licenseURL": "https://github.com/pnstack/codespace/blob/main/LICENSE",
"options": {},
"installsAfter": ["ghcr.io/devcontainers/features/python"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# install omf
curl -L https://get.oh-my.fish | fish
# install agnoster theme
omf theme agnoster | fish
12 changes: 12 additions & 0 deletions templates/ubuntu-dev/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
69 changes: 69 additions & 0 deletions templates/universal/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
{
"name": "Default Linux Universal",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/common-utils": {},

"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts",
"nvmVersion": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/tailscale/codespace/tailscale": {},
"ghcr.io/devcontainers/features/rust:1": {},
"ghcr.io/meaningful-ooo/devcontainer-features/fish:1": {},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/devcontainers/features/git-lfs:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest"
},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/neovim-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/vscode-server:1": {}
},
"runArgs": ["--device=/dev/net/tun"],
"customizations": {
"vscode": {
"extensions": ["npv2k1.theme-dracula-gray", "ms-azuretools.vscode-docker"]
}
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
12 changes: 12 additions & 0 deletions templates/universal/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
Loading