-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (48 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
66 lines (48 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Use Ubuntu 22.04 as the base image
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y tzdata
# Install Python and other dependencies as root before switching to user
RUN apt-get update && apt-get install -y \
python3.10 \
python3.10-dev \
curl \
gcc \
g++ \
make \
libmagic1 \
p7zip-full \
git \
tcpdump \
sudo
# Use update-alternatives to set python3.10 as the default python
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
# Set the working directory to /home/cuckoo
WORKDIR /home/installer
# Copy the requirements file into the container at /home/cape
COPY CAPEv2/installer/* /home/installer
# Install CAPEv2
RUN chmod a+x ./cape2.sh \
&& ./cape2.sh base cape \
&& ./cape2.sh all cape
# Install VirtualBox
COPY bin/vbox-client /usr/bin/VBoxManage
# Clean up
RUN rm -rf /home/installer
# Add the cape user to the sudo group
RUN usermod -aG sudo cape \
&& echo "cape ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/cape
# Set the password for the cape user
RUN echo "cape:cape" | chpasswd
# Copy the entrypoint script into the container at /home/cape
COPY scripts/entrypoint.sh /home/cape/entrypoint.sh
COPY scripts/cape-entry.service /etc/systemd/system/cape-entry.service
# enable the service
RUN systemctl enable cape-entry.service
USER cape
# Set the working directory to /opt/CAPEv2
WORKDIR /opt/CAPEv2
# Install dependencies
RUN poetry install
USER root
ENTRYPOINT ["/usr/sbin/init"]