forked from jmjos/ratatoskr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.remote-cpp-systemc-env
67 lines (57 loc) · 1.79 KB
/
Dockerfile.remote-cpp-systemc-env
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
66
67
# CLion remote docker environment (How to build docker container, run and stop it)
#
# Build and run:
# docker build -t clion/remote-cpp-systemc-env:0.5 -f Dockerfile.remote-cpp-systemc-env .
# docker run -d --cap-add sys_ptrace -p127.0.0.1:2222:22 --name clion_remote_systemc_env clion/remote-cpp-systemc-env:0.5
# ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:2222"
#
# stop:
# docker stop clion_remote_env
#
# ssh credentials (test user):
# user@password
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ARG SYSTEMC="systemc-2.3.3"
ARG SYSTEMC_HOME="/usr/local/${SYSTEMC}"
RUN apt-get update \
&& apt-get install -y ssh \
build-essential \
gcc \
g++ \
gdb \
clang \
cmake \
rsync \
tar \
python \
git \
libelf-dev \
libboost-all-dev \
libpugixml-dev \
libzmq3-dev \
software-properties-common \
python3-venv python3-pip \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install cpplint cmake
WORKDIR /tmp
ADD http://www.accellera.org/images/downloads/standards/systemc/${SYSTEMC}.tar.gz ${SYSTEMC}.tar.gz
RUN tar -xzf ${SYSTEMC}.tar.gz && cd ${SYSTEMC} \
&& mkdir BUILD && cd BUILD \
&& ../configure --prefix=${SYSTEMC_HOME} --enable-static CXXFLAGS="-std=c++17" \
&& make -j && make install \
&& cd ../.. \
&& rm -rf /tmp/*
ENV SYSTEMC_HOME ${SYSTEMC_HOME}
RUN ( \
echo 'LogLevel DEBUG2'; \
echo 'PermitRootLogin yes'; \
echo 'PasswordAuthentication yes'; \
echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \
) > /etc/ssh/sshd_config_test_clion \
&& mkdir /run/sshd
RUN useradd -m user \
&& yes password | passwd user
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_test_clion"]