summaryrefslogtreecommitdiff
path: root/scripts/docker-build/Dockerfile
blob: 449144733116581f215319d8d2a28b4a2bed8695 (plain)
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
# To execut the Docker build:
# ./build-docker.sh
# This should lead to a shell prompt as root.
# Then type:
# # > su -l mlbuilder
# $ > build-mlinux.sh
#
# Created user-id mlbuilder with password mlbuilder
#
#
FROM ubuntu:bionic
ENV APT="apt-get -y"

USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN cp /etc/apt/sources.list /etc/apt/sources.list~
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
RUN ${APT} update
RUN useradd -G sudo -s /bin/bash -m mlbuilder
RUN echo "export LANG=en_US.UTF-8" >>/home/mlbuilder/.profile
RUN echo "export LANGUAGE=en_US:en" >>/home/mlbuilder/.profile
RUN echo "export LC_ALL=en_US.UTF-8" >>/home/mlbuilder/.profile
RUN ${APT} build-dep qemu
RUN ${APT} remove oss4-dev
RUN ${APT} install apt-utils gawk wget git-core diffstat unzip texinfo gcc-multilib \
     build-essential chrpath socat iputils-ping locales language-pack-en cpio \
     xz-utils cmake lsof strace
RUN ${APT} install openssh-server
RUN sed -i 's/.*PermitEmptyPasswords no.*/PermitEmptyPasswords yes/' /etc/ssh/sshd_config
RUN echo "PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '" >>/home/mlbuilder/.bashrc
COPY mlinux-6.0.0.tar.gz /tmp
RUN mkdir -p /home/mlbuilder/.local/bin
COPY build-mlinux.sh /home/mlbuilder/.local/bin
RUN chmod 775 /home/mlbuilder/.local/bin/build-mlinux.sh
RUN chown -R mlbuilder:mlbuilder /home/mlbuilder
RUN su -l mlbuilder bash -c "tar -C /home/mlbuilder -xf /tmp/mlinux-6.0.0.tar.gz"
RUN rm /tmp/mlinux-6.0.0.tar.gz
RUN mkdir -p /run/sshd
RUN echo "mlbuilder:mlbuilder" >/home/mlbuilder/password.txt
RUN chpasswd < /home/mlbuilder/password.txt
EXPOSE 22/tcp
ENTRYPOINT /usr/sbin/sshd && bash