From aa20811a8ef53a4dc9b2b73b2b0c5beac592820c Mon Sep 17 00:00:00 2001 From: Neil-Jocelyn Schark <neil.schark@h-da.de> Date: Fri, 19 Jan 2024 14:34:14 +0000 Subject: [PATCH] Fix arm dev containers with did See merge request danet/gosdn!650 --- .devcontainer/Dockerfile | 9 ++++----- .devcontainer/devcontainer.json | 5 +++-- README.md | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d12d224a2..9e4fe1ec6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,5 @@ -# The devcontainer will be based on debian # The base container already has entrypoint, vscode user account, etc. out of the box -FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm +FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04 # Containerlab version will be set in devcontainer.json ARG _CLAB_VERSION @@ -33,6 +32,9 @@ RUN apt-get update \ # Install gnmic RUN bash -c "$(curl -sL https://get-gnmic.openconfig.net)" +# Install preferred version of the containerlab +RUN bash -c "$(curl -sL https://get.containerlab.dev)" -- -v ${_CLAB_VERSION} + # Install oh-my-zsh for more terminal features and set it as primary shell ENV SHELL /bin/zsh RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true @@ -40,6 +42,3 @@ RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh - # Set editor RUN echo "export VISUAL='nano'" >> /home/vscode/.zshrc RUN echo "export EDITOR='nano'" >> /home/vscode/.zshrc - -# Install preferred version of the containerlab -RUN bash -c "$(curl -sL https://get.containerlab.dev)" -- -v ${_CLAB_VERSION} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 81224c6c3..e83e2f26b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,8 +11,9 @@ "features": { // Containerlab will run in a docker-in-docker container // It is also possible to use docker-outside-docker feature - "ghcr.io/devcontainers/features/docker-in-docker:2.7": { - "version": "latest" + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest", + "dockerDashComposeVersion": "v2" }, "ghcr.io/devcontainers/features/go:1": { "version": "1.21" diff --git a/README.md b/README.md index 4a4fd16dc..479cd5e73 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,9 @@ The volume also means, that caches for things like `golang-ci lint` are persiste Furthermore, the folder `/root/docker` is a persistent volume, so that `docker login` credentials for root (used by containerlab) are also persistent. +For some changes to the dev container setup, mainly changes where the config lays in volumes later, the changes can only be applied if all volumes get deleted beforehand. +So if some things do not work in your dev container, maybe you missed an update. In that case stop the dev container, delete all volumes of this project and *rebuild* (not restart!) the container. + ### Dev container - remote -- GitLab