-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_builder
36 lines (29 loc) · 1.15 KB
/
Dockerfile_builder
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
ARG IMAGE
FROM ${IMAGE}
ARG UID=1000
ARG USER=builder
ARG ARCH
RUN useradd -m -u ${UID} -s /bin/bash ${USER}
# Non-interactive configuration of tzdata
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
RUN { echo 'tzdata tzdata/Areas select Etc'; echo 'tzdata tzdata/Zones/Etc select UTC'; } | debconf-set-selections
RUN apt-get update
RUN apt-get install -y cmake gdb python3 python3-pip openssh-server mc rsync libgpiod-dev
RUN pip3 install conan
USER ${USER}
RUN mkdir -p /home/${USER}/.ssh
RUN mkdir -p /home/${USER}/rpi-robot/cmake-build-debug-${ARCH}
RUN mkdir -p /home/${USER}/rpi-robot/cmake-build-debug-${ARCH}/bin
RUN mkdir -p /home/${USER}/rpi-robot/cmake-build-debug-${ARCH}/etc
RUN mkdir -p /home/${USER}/.conan2
RUN conan profile detect --force
COPY docker-configs/conan.${ARCH}.profile /home/${USER}/.conan2/profiles/default
COPY conanfile.txt /home/${USER}/rpi-robot/conanfile.txt
WORKDIR /home/${USER}/rpi-robot
RUN conan install . --output-folder=cmake-build-debug-${ARCH} --build=missing
COPY docker-configs/id_rsa_builder.pub /home/${USER}/.ssh/authorized_keys
USER root
RUN service ssh start
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]