-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
51 lines (43 loc) · 1.56 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:18.04
########################################################
# Essential packages for remote debugging and login in
########################################################
# Based on: https://github.com/shuhaoliu/docker-clion-dev
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
build-essential \
cmake \
g++ \
gcc \
gcc-multilib \
gdb \
gdbserver \
openssh-server \
qemu \
qemu-system-common \
rsync \
&& apt-get autoclean -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /var/run/sshd \
&& echo 'root:root' | chpasswd \
&& sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo "export VISIBLE=now" >> /etc/profile
# 22 for ssh server. 7777 for gdb server.
EXPOSE 22 7777
# You may choose to use a different user by uncommenting the RUN lines
# User: xv6_docker
# Password: pwd
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN useradd -ms /bin/bash xv6_docker && \
echo 'xv6_docker:pwd' | chpasswd
########################################################
# Add custom packages and development environment here
########################################################
COPY /util/* /root/
########################################################
CMD ["/usr/sbin/sshd", "-D"]