forked from courseworks/AP1400-2-HW2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (31 loc) · 991 Bytes
/
Dockerfile
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
FROM gcc:11.2.0
RUN apt-get -qq update \
&& apt-get -qq install --no-install-recommends openssh-server \
&& apt-get -qq install --no-install-recommends sudo \
&& apt-get -qq install --no-install-recommends cmake \
&& apt-get -qq install --no-install-recommends rsync \
&& apt-get -qq install --no-install-recommends libssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# setup ssh for use ubuntu, password 1234
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ubuntu
RUN echo 'ubuntu:1234' | chpasswd
RUN service ssh start
EXPOSE 22
# install google test
WORKDIR /usr/src/libraries
RUN git clone --depth=1 -b main https://github.com/google/googletest.git
WORKDIR /usr/src/libraries/googletest/build
RUN cmake .. \
&& make \
&& make install
# build the project
WORKDIR /usr/src/app
COPY . .
RUN rm -rf build
RUN mkdir build
WORKDIR /usr/src/app/build
RUN cmake ..
RUN make
# CMD ["/usr/sbin/sshd","-D"]
CMD ["./main"]