-
Notifications
You must be signed in to change notification settings - Fork 2
Debian:12 for base image, build pipeline and prefetch of srl image #1
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
Changes from all commits
6c21650
f364a48
f0a9852
cf65760
29af4bb
a00eaf4
baa6ffc
11d6b5d
8257652
6ca6008
9e73098
ee4e431
78ec49a
218e785
20a04bb
4c4c8f8
0e9fe79
253575d
feb60f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||||||||||||||||||||||||||||
| # ghcr.io/eda-labs/eda-devcontainer | ||||||||||||||||||||||||||||||||||||
| FROM mcr.microsoft.com/devcontainers/base:ubuntu | ||||||||||||||||||||||||||||||||||||
| FROM public.ecr.aws/docker/library/debian:bookworm-slim | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| ARG EDA_VERSION=25.12.1 | ||||||||||||||||||||||||||||||||||||
| ARG EDA_PLAYGROUND_REPO=kaelemc/playground | ||||||||||||||||||||||||||||||||||||
|
|
@@ -9,22 +9,39 @@ ENV EDA_VERSION=${EDA_VERSION//./-} | |||||||||||||||||||||||||||||||||||
| ENV EDA_PLAYGROUND_REPO=$EDA_PLAYGROUND_REPO | ||||||||||||||||||||||||||||||||||||
| ENV EDA_PLAYGROUND_DIR=$EDA_PLAYGROUND_DIR | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN apt-get update && apt-get install -y \ | ||||||||||||||||||||||||||||||||||||
| RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \ | ||||||||||||||||||||||||||||||||||||
| make \ | ||||||||||||||||||||||||||||||||||||
| git \ | ||||||||||||||||||||||||||||||||||||
| ca-certificates \ | ||||||||||||||||||||||||||||||||||||
| curl \ | ||||||||||||||||||||||||||||||||||||
| jq \ | ||||||||||||||||||||||||||||||||||||
| btop \ | ||||||||||||||||||||||||||||||||||||
| sudo \ | ||||||||||||||||||||||||||||||||||||
| zsh \ | ||||||||||||||||||||||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN useradd -m -s /bin/zsh vscode && \ | ||||||||||||||||||||||||||||||||||||
| groupadd -f docker && \ | ||||||||||||||||||||||||||||||||||||
| usermod -aG sudo,docker vscode && \ | ||||||||||||||||||||||||||||||||||||
| echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/vscode && \ | ||||||||||||||||||||||||||||||||||||
| chmod 0440 /etc/sudoers.d/vscode | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| COPY --chmod=755 scripts/ /usr/local/bin/. | ||||||||||||||||||||||||||||||||||||
| COPY codespaces-4vcpu-kpt-setters.yaml /eda-codespaces/codespaces-4vcpu-kpt-setters.yaml | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash | ||||||||||||||||||||||||||||||||||||
| RUN curl -fsSL --retry 3 https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=v5.8.3 bash | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN echo "export PATH=$PATH:$EDA_PLAYGROUND_DIR/tools" >> /etc/profile | ||||||||||||||||||||||||||||||||||||
| # Add EDA Playground tools to PATH (zsh) | ||||||||||||||||||||||||||||||||||||
| RUN echo 'export PATH="$PATH:$EDA_PLAYGROUND_DIR/tools"' >> /etc/zsh/zshrc | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| USER vscode | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN git clone "https://github.com/$EDA_PLAYGROUND_REPO" $EDA_PLAYGROUND_DIR && cd $EDA_PLAYGROUND_DIR && make download-tools | ||||||||||||||||||||||||||||||||||||
| RUN git clone --depth 1 "https://github.com/$EDA_PLAYGROUND_REPO" $EDA_PLAYGROUND_DIR && cd $EDA_PLAYGROUND_DIR && make download-tools | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| RUN curl -o $HOME/.bundle.yaml "https://raw.githubusercontent.com/nokia-eda/edaadm/refs/heads/main/bundles/eda-bundle-core-$EDA_VERSION.yaml" && \ | ||||||||||||||||||||||||||||||||||||
| $EDA_PLAYGROUND_DIR/tools/yq '.assets.registries[] | .name as $reg | .images[] | .name as $img | .tags[] | $reg + "/" + $img + ":" + .' $HOME/.bundle.yaml > $HOME/.images.txt | ||||||||||||||||||||||||||||||||||||
| $EDA_PLAYGROUND_DIR/tools/yq '.assets.registries[] | .name as $reg | .images[] | .name as $img | .tags[] | $reg + "/" + $img + ":" + .' $HOME/.bundle.yaml > $HOME/.images.txt | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| SHELL ["/bin/bash", "-c"] | ||||||||||||||||||||||||||||||||||||
| RUN SRL=$(curl -s "https://raw.githubusercontent.com/nokia-eda/playground/refs/heads/main/topology/3-nodes-srl.yaml" | $EDA_PLAYGROUND_DIR/tools/yq '.spec.nodeTemplates | filter(.name == "default").[].nodeProfile'); \ | ||||||||||||||||||||||||||||||||||||
| curl "https://raw.githubusercontent.com/nokia-eda/kpt/refs/heads/main/eda-kpt-playground/$SRL/engine_v1_nodeprofile_srlinux_${SRL//[^0-9.]/}.yaml" | \ | ||||||||||||||||||||||||||||||||||||
| $EDA_PLAYGROUND_DIR/tools/yq '.spec.containerImage' >> $HOME/.images.txt | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+47
|
||||||||||||||||||||||||||||||||||||
| RUN SRL=$(curl -s "https://raw.githubusercontent.com/nokia-eda/playground/refs/heads/main/topology/3-nodes-srl.yaml" | $EDA_PLAYGROUND_DIR/tools/yq '.spec.nodeTemplates | filter(.name == "default").[].nodeProfile'); \ | |
| curl "https://raw.githubusercontent.com/nokia-eda/kpt/refs/heads/main/eda-kpt-playground/$SRL/engine_v1_nodeprofile_srlinux_${SRL//[^0-9.]/}.yaml" | \ | |
| $EDA_PLAYGROUND_DIR/tools/yq '.spec.containerImage' >> $HOME/.images.txt | |
| RUN set -euo pipefail; \ | |
| SRL=$(curl -fsSL "https://raw.githubusercontent.com/nokia-eda/playground/refs/heads/main/topology/3-nodes-srl.yaml" | \ | |
| "$EDA_PLAYGROUND_DIR/tools/yq" '.spec.nodeTemplates | filter(.name == "default").[].nodeProfile'); \ | |
| if [[ -z "${SRL:-}" ]]; then \ | |
| echo "Error: Failed to retrieve SRL node profile from topology definition." >&2; \ | |
| exit 1; \ | |
| fi; \ | |
| IMAGE_URL=$(curl -fsSL "https://raw.githubusercontent.com/nokia-eda/kpt/refs/heads/main/eda-kpt-playground/$SRL/engine_v1_nodeprofile_srlinux_${SRL//[^0-9.]/}.yaml" | \ | |
| "$EDA_PLAYGROUND_DIR/tools/yq" '.spec.containerImage'); \ | |
| if [[ -z "${IMAGE_URL:-}" ]]; then \ | |
| echo "Error: Failed to extract SRL container image from node profile." >&2; \ | |
| exit 1; \ | |
| fi; \ | |
| echo "$IMAGE_URL" >> "$HOME/.images.txt" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||
| # This setters file is meant for use in codespaces (4vcpu) VMs | ||||||
| # to provide configuration for the EDA platform | ||||||
| # It is applied in the codespaces post-create script as an argument to `make try-eda. | ||||||
|
||||||
| # It is applied in the codespaces post-create script as an argument to `make try-eda. | |
| # It is applied in the codespaces post-create script as an argument to `make try-eda`. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| { | ||||||
| "name": "Nokia EDA in GitHub Codespaces", | ||||||
| "image": "ghcr.io/eda-labs/eda-devcontainer:latest", | ||||||
| "image": "ghcr.io/eda-labs/codespaces/base:pr-1", | ||||||
|
||||||
| "image": "ghcr.io/eda-labs/codespaces/base:pr-1", | |
| "image": "ghcr.io/eda-labs/codespaces/base:latest", |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,55 @@ | ||||||||||||||||||||||||||||||||||||||||||
| name: Build Devcontainer Image | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| "on": | ||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||
| types: | ||||||||||||||||||||||||||||||||||||||||||
| - published | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||
| REGISTRY: ghcr.io | ||||||||||||||||||||||||||||||||||||||||||
| IMAGE_NAME: ghcr.io/eda-labs/codespaces/base | ||||||||||||||||||||||||||||||||||||||||||
| DOCKERFILE: .devcontainer/Dockerfile | ||||||||||||||||||||||||||||||||||||||||||
| CONTEXT: .devcontainer/ | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||||||||||
| name: Build and Push | ||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-24.04 | |
| runs-on: ubuntu-22.04 |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow pushes images on every pull request (type=ref,event=pr), which could clutter the registry with numerous PR images. Consider whether images should only be pushed on merge to main or specific branches, or add cleanup logic for PR images.
| type=ref,event=pr | |
| type=ref,event=tag | |
| type=sha | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ${{ env.CONTEXT }} | |
| file: ${{ env.DOCKERFILE }} | |
| push: true | |
| type=ref,event=tag | |
| type=sha | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| with: | |
| context: ${{ env.CONTEXT }} | |
| file: ${{ env.DOCKERFILE }} | |
| push: ${{ github.event_name != 'pull_request' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curlis downloading and pipinghttps://raw.githubusercontent.com/k3d-io/k3d/main/install.shdirectly intobashwhile running as root, and the script is only pinned to the mutablemainbranch with no integrity verification. If the k3d GitHub repo or the network path is compromised, an attacker can serve arbitrary shell commands and gain code execution in the build environment (and any CI/CD context using this Dockerfile). To mitigate this, pin to an immutable reference (e.g., a specific commit or release asset) and verify its integrity (checksum/signature) before execution, or vendor the installer script in the repo instead of executing it directly from the network.