-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
92 lines (84 loc) · 2.29 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
# Install tools required to build the system using bitbake
RUN \
apt-get update && \
apt-get install -y \
--no-install-recommends \
git \
ssh \
build-essential \
bash \
chrpath \
file \
gawk \
texinfo \
perl \
coreutils \
tar \
patch \
wget \
findutils \
diffutils \
quilt \
diffstat \
locales \
cpio \
lftp \
cmake \
libssl-dev \
libseccomp-dev \
gnutls-bin \
liblz4-tool \
zstd \
bmap-tools \
# Python3 related
python3 \
python3-pip \
python3-distutils \
#
&& rm -rf /var/lib/apt/lists/*
#
# Configure locale, python/bitbake have problems without valid locale
RUN \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Make bash default
RUN ln -sf /bin/bash /bin/sh
# Install pkcs11-proxy
RUN \
git config --global http.sslVerify "false" && \
git clone https://github.com/SUNET/pkcs11-proxy /tmp/pkcs11-proxy && \
cd /tmp/pkcs11-proxy && cmake . && make && make install && \
rm -rf /tmp/pkcs11-proxy
ENV RAUC_PKCS11_MODULE /usr/local/lib/libpkcs11-proxy.so
# Python3: Install
RUN \
# PySerial
python3 -m pip install --no-cache-dir pyserial && \
# usbsdmux
python3 -m pip install --no-cache-dir usbsdmux && \
# We want to add usbsdmux UDEV rules as well
mkdir -p /etc/udev/rules.d/ && \
wget https://raw.githubusercontent.com/linux-automation/usbsdmux/master/contrib/udev/99-usbsdmux.rules -O /etc/udev/rules.d/99-usbsdmux.rules
# Create use that will run the build
RUN \
useradd \
--create-home \
--user-group docker-build-user \
--uid 1234 && \
usermod -aG plugdev,dialout,disk docker-build-user
USER docker-build-user
WORKDIR /home/docker-build-user/
# Setup ssh to trust git server
# Consolidate to prevent issues
RUN \
mkdir -p .ssh && \
chmod 700 .ssh && \
ssh-keyscan gitlab.com >> .ssh/known_hosts && \
git config --global safe.directory /builds/prusa3d/sl1/meta-sl1
# enables GitLab's Interactive Web Terminal feature
EXPOSE 8093