Skip to content

Commit

Permalink
Use single devcontianer for dev and codespaces usage (#2083)
Browse files Browse the repository at this point in the history
* use single devcontianer for dev and codespaces usage

* rename a job
  • Loading branch information
hellt authored Jun 10, 2024
1 parent fc94dd4 commit 67746bf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ RUN mkdir -p /root/.docker && echo "{}" > /root/.docker/config.json
# vscode user is created in the MS devcontainer image
USER vscode

COPY ./dclab /usr/local/bin/dclab

# create ssh key for vscode user to enable passwordless ssh to devices
RUN ssh-keygen -t ecdsa -b 256 -N "" -f ~/.ssh/id_ecdsa

Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/dclab
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
/workspaces/containerlab/bin/containerlab "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {}
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.21"
}
},
"remoteUser": "vscode",
"customizations": {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# atuin
bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)
# bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/atuinsh/atuin/releases/download/v18.3.0/atuin-installer.sh | sh

# theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: codespaces-devcontainer
name: build-devcontainer
on:
workflow_dispatch:
inputs:
Expand All @@ -19,7 +19,7 @@ env:
REGISTRY: ghcr.io

jobs:
codespaces-devcontainer:
devcontainer:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down Expand Up @@ -56,12 +56,11 @@ jobs:
echo "TAGS=$TAGS" >> $GITHUB_OUTPUT
shell: bash

- name: Pre-build dev container image 🔨
- name: Build dev container image
uses: devcontainers/[email protected]
env:
CLAB_VERSION: ${{ inputs.clab_version }}
with:
subFolder: .github/containers/codespaces
imageName: ghcr.io/${{ github.repository }}/clab-codespaces
imageName: ghcr.io/${{ github.repository }}/clab-devcontainer
imageTag: ${{ steps.extract-tags.outputs.tags }}
push: always

0 comments on commit 67746bf

Please sign in to comment.