-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (50 loc) · 2.16 KB
/
Dockerfile
File metadata and controls
68 lines (50 loc) · 2.16 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
66
67
68
# Build and run:
# docker build -t clion/ubuntu/cpp-env:1.0 -f Dockerfile.cpp-env-ubuntu .
FROM ubuntu:22.04
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.25.0"
ENV DEBIAN_FRONTEND=noninteractive
# Dataspree network hack. Avoids timeout.
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get -y install build-essential clang make cmake autoconf automake libtool valgrind locales-all dos2unix rsync tar openssh-server gdb lsb-release wget software-properties-common gnupg curl ccache libgtk2.0-dev
# Install CMake
COPY ./reinstall-cmake.sh /tmp/
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh
RUN cmake --version \
&& which cmake
# Install clang++
RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
RUN apt-get update \
&& apt-get -y install --no-install-recommends python3-pip
RUN apt-get -y install clang-tools-16 clang-16
# Configure SSH
RUN /usr/bin/echo -e 'LogLevel DEBUG2\nPermitRootLogin yes\nPasswordAuthentication yes\nPasswordAuthentication yes\nSubsystem sftp /usr/lib/openssh/sftp-server' > /etc/ssh/sshd_config
RUN mkdir /run/sshd
RUN ssh-keygen -A && service ssh --full-restart
#RUN echo "export PATH=$PATH:/root/.local/bin" >> /root/.bashrc \
#echo "export CC=clang CXX=clang++" >> /root/.bashrc
#ENV PATH "$PATH:/root/.local/bin"
RUN groupadd -r dataspree && useradd -g dataspree dataspree
ENV HOME /root
ENV CC /usr/bin/clang-16
ENV CXX /usr/bin/clang++-16
RUN chown -R dataspree:dataspree /root
ENV CONAN_USER_HOME=/root/
ENV PATH "$PATH:/root/.local/bin"
COPY --chown=dataspree:dataspree ./conan-profile /tmp/root/.conan/profiles/default
RUN which clang && which clang++
RUN ls /usr/bin/clang
RUN rm /usr/bin/clang
RUN rm /usr/bin/clang++
RUN ln -s /usr/bin/clang++-16 /usr/bin/clang++
RUN ln -s /usr/bin/clang-16 /usr/bin/clang
RUN apt install -y libstdc++-12-dev
USER dataspree
RUN python3 -m pip install --user conan==1.56.0
RUN mkdir -p /root/.conan/data
RUN ls -ltra /root/.conan/data
#USER root
#CMD /usr/sbin/sshd -D -e -f /etc/ssh/sshd_config
#CMD tail -f /dev/null