Skip to content

Commit c859b50

Browse files
committed
Introduce devcontainer
1 parent 85e86cc commit c859b50

3 files changed

Lines changed: 47 additions & 18 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM ubuntu:24.04
2+
3+
# pre-seed the timezone info
4+
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
5+
# install sudo as it's not in the base image & installing_deps.sh expects it
6+
&& apt-get update && apt-get install --assume-yes git sudo \
7+
# Make sudo works right away
8+
&& echo 'ubuntu ALL=(root) NOPASSWD:ALL' > /etc/sudoers.d/ubuntu \
9+
&& chmod 0440 /etc/sudoers.d/ubuntu
10+
11+
USER ubuntu

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// For format details, see https://aka.ms/devcontainer.json.
2+
{
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
7+
"remoteUser": "ubuntu",
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
"onCreateCommand": "git submodule update --init --recursive",
14+
15+
// Use 'postCreateCommand' to run commands after the container is created.
16+
"postCreateCommand": "./installing_deps.sh",
17+
18+
// Configure tool-specific properties.
19+
// "customizations": {},
20+
}

installing_deps.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,37 @@ set -e
88

99
sudo apt-get update
1010

11-
sudo apt-get install python3-pip virtualenv python3-dev python3-tk libfreetype6-dev \
12-
screen g++ unzip libsnappy-dev cmake -qq
13-
14-
sudo apt-get install automake libtool make gcc pkg-config -qq
11+
packages="python3-pip virtualenv python3-dev python3-tk libfreetype6-dev screen g++ unzip libsnappy-dev cmake automake libtool make gcc pkg-config"
1512

1613
#Needed for downloading jemalloc
17-
sudo apt-get install wget -qq
14+
packages="${packages} wget"
1815

1916
#Needed for bloom filters
20-
sudo apt-get install libssl-dev libfreetype6-dev python3-numpy -qq
17+
packages="${packages} libssl-dev libfreetype6-dev python3-numpy"
2118

2219
# pycld3
23-
sudo apt-get install protobuf-compiler libprotobuf-dev -qq
20+
packages="${packages} protobuf-compiler libprotobuf-dev"
2421

2522
# qrcode
26-
sudo apt-get install python3-opencv -y
27-
sudo apt-get install libzbar0 -y
23+
packages="${packages} python3-opencv libzbar0"
2824

2925
# DNS deps
30-
sudo apt-get install libadns1 libadns1-dev -qq
26+
packages="${packages} libadns1 libadns1-dev"
3127

3228
#Needed for redis-lvlDB
33-
sudo apt-get install libev-dev libgmp-dev -qq # TODO NEED REVIEW
29+
packages="${packages} libev-dev libgmp-dev" # TODO NEED REVIEW
3430

3531
#Need for generate-data-flow graph
36-
sudo apt-get install graphviz -qq
32+
packages="${packages} graphviz"
3733

3834
# ssdeep
39-
sudo apt-get install libfuzzy-dev -qq
40-
sudo apt-get install build-essential libffi-dev autoconf -qq
35+
packages="${packages} libfuzzy-dev build-essential libffi-dev autoconf"
4136

4237
# sflock, gz requirement
43-
sudo apt-get install p7zip-full -qq # TODO REMOVE ME
38+
packages="${packages} p7zip-full" # TODO REMOVE ME
39+
40+
# resolve needed packages & install all at once while keeping history of why some packages are needed.
41+
sudo apt-get install --assume-yes ${packages}
4442

4543
# SUBMODULES #
4644
git submodule update --init --recursive
@@ -49,7 +47,7 @@ git submodule update --init --recursive
4947
test ! -d redis/ && git clone https://github.com/redis/redis.git
5048
pushd redis/
5149
git checkout 5.0
52-
make
50+
make -j
5351
popd
5452

5553
# tlsh
@@ -67,7 +65,7 @@ test ! -d pgpdump && git clone https://github.com/kazu-yamamoto/pgpdump.git
6765
pushd pgpdump/
6866
autoreconf -fiW all
6967
./configure
70-
make
68+
make -j
7169
sudo make install
7270
popd
7371

@@ -79,7 +77,7 @@ unzip yara_temp/yara.zip -d yara_temp/
7977
pushd yara_temp/yara-${YARA_VERSION}
8078
./bootstrap.sh
8179
./configure
82-
make
80+
make -j
8381
sudo make install
8482
make check
8583
popd

0 commit comments

Comments
 (0)