Skip to content

Instantly share code, notes, and snippets.

@Trass3r
Last active September 1, 2021 07:53
Show Gist options
  • Save Trass3r/55cccb10eb7b9dc72653a67336dd15e8 to your computer and use it in GitHub Desktop.
Save Trass3r/55cccb10eb7b9dc72653a67336dd15e8 to your computer and use it in GitHub Desktop.
Alpine Test Container
{
"name": "Alpine",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Alpine version: 3.11, 3.12, 3.13, 3.14
"args": { "VARIANT": "3.14" }
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
// Note that some extensions may not work in Alpine Linux. See https://aka.ms/vscode-remote/linux.
"extensions": [
"ms-vscode.cpptools"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
FROM mcr.microsoft.com/vscode/devcontainers/base:dev-alpine-3.14
RUN apk add --no-cache gdb file g++ clang coreutils
#RUN rm /etc/alpine-release \
#&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
#&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk \
#&& apk add glibc-2.33-r0.apk
#&& apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing mono gdb
#ENV LD_LIBRARY_PATH=/usr/glibc-compat/lib:/usr/lib:/lib
# RUN apk add --no-cache coreutils wget file \
# bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib \
# && wget https://dot.net/v1/dotnet-install.sh \
# && chmod +x dotnet-install.sh \
# && ./dotnet-install.sh -c 5.0
# mono OpenDebugAD7.dll --help
# ~/.dotnet/dotnet OpenDebugAD7.dll --help
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"logging": {
"engineLogging": true,
"trace": true,
"traceResponse": true
}
}
]
}
#include <stdio.h>
int main()
{
printf("Hello\n");
for (int i = 0; i < 10; ++i)
{
printf("%d ", i);
}
}
{
"C_Cpp.intelliSenseEngine": "Disabled",
"C_Cpp.updateChannel": "Insiders",
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"group": {
"kind": "build",
"isDefault": true
},
"type": "shell",
"command": "clang++ -static-libstdc++ -static-libgcc -g main.cpp -o main"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment