From c665b649669166782f72add675dff8bf5feb9b88 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 7 Jul 2023 09:35:37 +0200 Subject: [PATCH] tutorial: base image and dev container --- .devcontainer/devcontainer.json | 20 ++++++++++++++++++++ builder.Dockerfile | 21 +++++++++++++++++++++ makefile | 4 ++++ 3 files changed, 45 insertions(+) create mode 100755 .devcontainer/devcontainer.json create mode 100644 builder.Dockerfile create mode 100644 makefile diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100755 index 0000000..f771018 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,20 @@ +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/cpp +{ + "name": "C", + "build": { + "dockerfile": "../builder.Dockerfile" + }, + "runArgs": ["--platform=linux/amd64"], + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + // Faster install of extensions - and currently seems to be problematic on macos + // https://github.com/microsoft/vscode-remote-release/issues/8169 + "extensions.verifySignature": false + }, + "extensions": ["ms-vscode.cpptools", "ms-vscode.cmake-tools", "cschlosser.doxdocgen"] + } + } +} diff --git a/builder.Dockerfile b/builder.Dockerfile new file mode 100644 index 0000000..c42d05b --- /dev/null +++ b/builder.Dockerfile @@ -0,0 +1,21 @@ +ARG base_tag=bullseye +ARG base_img=mcr.microsoft.com/vscode/devcontainers/base:dev-${base_tag} +# ARG base_img=debian:${base_tag} + +FROM --platform=linux/amd64 ${base_img} AS builder-install + +RUN apt-get update --fix-missing && apt-get -y upgrade +RUN apt-get install -y --no-install-recommends \ + apt-utils \ + curl \ + cmake \ + build-essential \ + gcc \ + g++-multilib \ + locales \ + make \ + ruby \ + gcovr \ + wget \ + && rm -rf /var/lib/apt/lists/* + diff --git a/makefile b/makefile new file mode 100644 index 0000000..03cf9cc --- /dev/null +++ b/makefile @@ -0,0 +1,4 @@ +project_name=cproject + +builder-build : + docker build -f builder.Dockerfile -t $(project_name)-builder:latest .