Skip to content

Commit 454a106

Browse files
committed
docker: extract dependency installation to make it reusable
1 parent 8684dd8 commit 454a106

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

.github/actions/setup-dependencies/action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@ description: "Install all required dependencies for worflows to run."
99
runs:
1010
using: "composite"
1111
steps:
12-
- name: Install 3rd party from apt
13-
run: sudo apt install e2fsprogs p7zip-full unar zlib1g-dev liblzo2-dev lz4 lzop lziprecover img2simg zstd
14-
shell: bash
15-
16-
- name: Install sasquatch
17-
run: |
18-
curl -L -o sasquatch_1.0_amd64.deb https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v4.5.1-4/sasquatch_1.0_amd64.deb
19-
sudo dpkg -i sasquatch_1.0_amd64.deb
20-
rm -f sasquatch_1.0_amd64.deb
12+
- name: Install 3rd party dependencies
13+
run: sudo unblob/install-deps.sh
2114
shell: bash
2215

2316
- name: Setup Python

Dockerfile

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,8 @@ RUN chown -R unblob /data
66

77
WORKDIR /data/output
88

9-
RUN apt-get update && apt-get install --no-install-recommends -y \
10-
curl \
11-
e2fsprogs \
12-
gcc \
13-
git \
14-
img2simg \
15-
liblzo2-dev \
16-
lz4 \
17-
lziprecover \
18-
lzop \
19-
p7zip-full \
20-
unar \
21-
xz-utils \
22-
zlib1g-dev \
23-
libmagic1 \
24-
zstd
25-
RUN curl -L -o sasquatch_1.0_amd64.deb https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v4.5.1-4/sasquatch_1.0_amd64.deb \
26-
&& dpkg -i sasquatch_1.0_amd64.deb \
27-
&& rm -f sasquatch_1.0_amd64.deb
9+
COPY unblob/install-deps.sh /
10+
RUN /install-deps.sh
2811

2912
USER unblob
3013
ENV PATH="/home/unblob/.local/bin:${PATH}"

docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ The Nix derivation installs all 3rd party dependencies.
111111

112112
## Install extractors
113113

114+
There is a handy `install-deps.sh` script included in the repository and PyPI packages that can be used to install the following dependencies.
115+
114116
1. With your operating system package manager:
115117
On Ubuntu 22.04, install extractors with APT:
116118

unblob/install-deps.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#/bin/sh -xeu
2+
3+
apt-get update
4+
5+
apt-get install --no-install-recommends -y \
6+
curl \
7+
e2fsprogs \
8+
gcc \
9+
git \
10+
img2simg \
11+
liblzo2-dev \
12+
lz4 \
13+
lziprecover \
14+
lzop \
15+
p7zip-full \
16+
unar \
17+
xz-utils \
18+
zlib1g-dev \
19+
libmagic1 \
20+
zstd
21+
22+
curl -L -o sasquatch_1.0_amd64.deb https://github.com/onekey-sec/sasquatch/releases/download/sasquatch-v4.5.1-4/sasquatch_1.0_amd64.deb
23+
dpkg -i sasquatch_1.0_amd64.deb
24+
rm -f sasquatch_1.0_amd64.deb

0 commit comments

Comments
 (0)