-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (72 loc) · 2.19 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
# This docker file is used to create a docker image with Petalinux installed
# The main purpose of this docker image is to build petalinux projects in a CI/CD pipeline
FROM ubuntu:18.04
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
autoconf \
bc \
bison \
build-essential \
device-tree-compiler \
expect \
gawk \
gcc-multilib \
libpython3.8-dev \
libncurses5-dev \
libtool \
libtool-bin \
locales \
net-tools \
pylint3 \
python \
python3 \
python3-pexpect \
python3-pip \
python3-git \
python3-jinja2 \
rsync \
screen \
sudo \
texinfo \
tftpd \
xterm \
xxd \
xz-utils \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN dpkg --add-architecture i386 && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
zlib1g:i386 libc6-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8 && update-locale
# Make a petalinux user (Petalinux cannot be installed to root)
RUN adduser --disabled-password --gecos '' petalinux
RUN usermod -aG sudo petalinux
RUN echo "petalinux ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ARG PETA_RUN_FILE="petalinux-v2022.2-10141622-installer.run"
# Copy the installer and the EULA acceptance script to the container
COPY ./accept_eula.sh /home/petalinux
COPY ./build_image.sh /home/petalinux
COPY ./petalinux-v2022.2-10141622-installer.run /home/petalinux
WORKDIR /home/petalinux
# Run the Petalinux installer
RUN chmod a+rx /home/petalinux/${PETA_RUN_FILE}
RUN chmod a+rx /home/petalinux/accept_eula.sh
RUN mkdir -p /opt/Xilinx
RUN chmod 777 /tmp /opt/Xilinx
RUN cd /tmp
RUN sudo -u petalinux -i /home/petalinux/accept_eula.sh /home/petalinux/${PETA_RUN_FILE} /opt/Xilinx/petalinux
RUN rm -f /home/petalinux/${PETA_RUN_FILE}
RUN echo "root:petalinux" | chpasswd
USER petalinux
ENV HOME=/home/petalinux
ENV LANG=en_US.UTF-8
USER root
RUN echo "/usr/sbin/in.tftpd --foreground --listen --address [::]:69 --secure /tftpboot" >> /etc/profile && \
echo ". /opt/Xilinx/petalinux/settings.sh" >> /etc/profile && \
echo ". /etc/profile" >> /root/.profile
EXPOSE 69/udp
USER petalinux
ENTRYPOINT ["/bin/bash", "-l"]