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

dind devcontainer part2 #2059

Merged
merged 10 commits into from
Jun 7, 2024
Merged
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
13 changes: 13 additions & 0 deletions .github/containers/codespaces/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM public.ecr.aws/docker/library/debian:12-slim

ARG CLAB_VERSION

RUN echo "deb [trusted=yes] https://netdevops.fury.site/apt/ /" | \
tee -a /etc/apt/sources.list.d/netdevops.list

RUN if [ -z "$CLAB_VERSION" ]; then \
apt update && apt install -y --no-install-recommends containerlab; \
else \
apt update && apt install -y --no-install-recommends containerlab=${CLAB_VERSION}; \
fi

Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"build": {
"dockerfile": "./Dockerfile",
"context": "."
// "args": {
// "USERNAME": "${localEnv:USERNAME}"
// }
},
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
Expand All @@ -17,6 +11,7 @@
"version": "latest"
}
},
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
Expand Down
5 changes: 0 additions & 5 deletions .github/containers/dind/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: dind-devcontainer
name: codespaces-devcontainer
on:
workflow_dispatch:
inputs:
CLAB_VERSION:
description: "Containerlab version"
required: false

env:
REGISTRY: ghcr.io

jobs:
dind-devcontainer:
name: lint
codespaces-devcontainer:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand All @@ -34,14 +37,19 @@ jobs:
# git short commit
type=sha

- name: Extract tags
id: extract-tags
run: |
TAGS=$(echo '${{ steps.meta.outputs.tags }}' | awk -F: '{print $2}' | paste -sd "," -)
echo "TAGS=$TAGS" >> $GITHUB_OUTPUT
shell: bash

- name: Pre-build dev container image 🔨
uses: devcontainers/ci@v0.3
# env:
# USERNAME: ${{ inputs.username }}
# UID: ${{ inputs.user_id }}
# GID: ${{ inputs.group_id }}
env:
CLAB_VERSION: ${{ inputs.clab_version }}
with:
subFolder: .github/containers/dind
imageName: ghcr.io/${{ github.repository }}/clab-dind
imageTag: ${{ steps.meta.outputs.tags }}
subFolder: .github/containers/codespaces
imageName: ghcr.io/${{ github.repository }}/clab-codespaces
imageTag: ${{ steps.extract-tags.outputs.tags }}
push: always