Skip to content

Commit 74e4fcc

Browse files
authored
Merge pull request #127 from brendandburns/devcontainer
Add a devcontainer configuration
2 parents 0e1055b + edfed59 commit 74e4fcc

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/ubuntu/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
4+
ARG VARIANT="jammy"
5+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
6+
7+
RUN apt-get update && \
8+
apt-get install -qq -y git libssl-dev libcurl4-openssl-dev uncrustify cmake g++
9+
10+
RUN git clone https://libwebsockets.org/repo/libwebsockets --depth 1 --branch v4.2-stable && \
11+
cd libwebsockets && \
12+
mkdir build && \
13+
cd build && \
14+
cmake -DLWS_WITHOUT_TESTAPPS=ON -DLWS_WITHOUT_TEST_SERVER=ON-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
15+
-DLWS_WITHOUT_TEST_PING=ON -DLWS_WITHOUT_TEST_CLIENT=ON -DCMAKE_C_FLAGS="-fpic" -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
16+
make && make install
17+
18+
# Build pre-requisite: libyaml
19+
RUN git clone https://github.com/yaml/libyaml --depth 1 --branch release/0.2.5 && \
20+
cd libyaml && \
21+
mkdir build && \
22+
cd build && \
23+
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON .. && \
24+
make && \
25+
make install
26+

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
8+
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
9+
"args": { "VARIANT": "ubuntu-22.04" }
10+
},
11+
12+
// Set *default* container specific settings.json values on container create.
13+
"settings": {},
14+
15+
16+
// Add the IDs of extensions you want installed when the container is created.
17+
"extensions": [],
18+
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
// "forwardPorts": [],
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
// "postCreateCommand": "uname -a",
24+
25+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
26+
"remoteUser": "vscode"
27+
}

0 commit comments

Comments
 (0)