Skip to content

Commit ce8fe2c

Browse files
committed
Add the scripts for the docker container
1 parent 09ecd34 commit ce8fe2c

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

Container/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM ubuntu:16.04
2+
ENV USER=deploy
3+
ENV PASSWD=deploy
4+
ENV WORKDIR=SDSSE
5+
ENV TZ=Australia/Melbourne
6+
7+
ARG DEBIAN_FRONTEND=noninteractive
8+
RUN apt update \
9+
&& apt install -y ssh openssh-server build-essential \
10+
gcc g++ gdb gdbserver \
11+
rsync \
12+
sudo git \
13+
flex bison \
14+
libgmp-dev \
15+
&& apt clean
16+
17+
RUN useradd -m ${USER} && yes ${PASSWD} | passwd ${USER}
18+
19+
RUN echo ${USER}' ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
20+
RUN chmod 644 /etc/sudoers
21+
22+
CMD ["/usr/sbin/sshd", "-D"]
23+
24+
USER ${USER}
25+
RUN mkdir -p /home/${USER}/${WORKDIR}/
26+
WORKDIR /home/${USER}/${WORKDIR}/
27+
ENV LC_ALL C.UTF-8
28+
29+
RUN wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz \
30+
&& tar zxf pbc-0.5.14.tar.gz \
31+
&& cd pbc-0.5.14 \
32+
&& ./configure \
33+
&& make \
34+
&& sudo make install && cd .. \
35+
&& wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz \
36+
&& tar -zxf openssl-1.1.0h.tar.gz && cd openssl-1.1.0h \
37+
&& ./config \
38+
&& make \
39+
&& sudo make install && cd ..\
40+
&& wget https://github.com/Kitware/CMake/archive/refs/tags/v3.17.0.tar.gz \
41+
&& tar -zxf v3.17.0.tar.gz && cd CMake-3.17.0 \
42+
&& ./bootstrap && make && sudo make install

Container/docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
x-defaults: &default
2+
restart: unless-stopped
3+
# Build from the Dockfile in the current path
4+
build: .
5+
volumes:
6+
# mount the source code folder
7+
- ..:/home/deploy/SDSSE/
8+
- /tmp:/tmp
9+
10+
services:
11+
projects-dev:
12+
<<: *default
13+
container_name: SDSSE-dev
14+
hostname: "SDSSE"
15+
# Set username and work dir
16+
user: deploy
17+
working_dir: /home/deploy/SDSSE
18+
# Enable GDB server to run
19+
security_opt:
20+
- seccomp:unconfined
21+
cap_add:
22+
- SYS_PTRACE
23+
# Start ssh service
24+
# Use tail -f to run the container in the background
25+
command:
26+
bash -c "sudo service ssh restart && tail -f /dev/null"
27+
# Map 22 to 2222 in local machine
28+
ports:
29+
- "127.0.0.1:3333:22"

0 commit comments

Comments
 (0)