Dockerfile 1.81 KB
Newer Older
1
FROM ubuntu:18.04
z4yx's avatar
z4yx committed
2
3
4

MAINTAINER z4yx <z4yx@users.noreply.github.com>

5
6
7
8
9
# Build with:
# docker build \
#   --build-arg PETA_VERSION=2018.1 \
#   --build-arg PETA_RUN_FILE=petalinux-v2018.1-final-installer.run \
#   -t petalinux:2018.1 .
z4yx's avatar
z4yx committed
10

11
ENV DEBIAN_FRONTEND=noninteractive
Sam's avatar
Sam committed
12

z4yx's avatar
z4yx committed
13
#install dependences:
14
15
RUN dpkg --add-architecture i386 && \
    apt-get update && \
16
17
18
    apt-get install -y -q gcc git make net-tools libncurses5-dev \
    tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget \
    diffstat chrpath socat xterm autoconf libtool tar unzip texinfo \
Steffen Vogel's avatar
Steffen Vogel committed
19
20
21
22
    zlib1g-dev gcc-multilib build-essential zlib1g:i386 screen pax \
    gzip \
    locales sudo texinfo gzip unzip cpio chrpath autoconf lsb-release \
    libtool-bin kmod rsync bc u-boot-tools update-inetd xvfb \
Steffen Vogel's avatar
Steffen Vogel committed
23
    libgtk2.0-0 libsdl1.2-dev libglib2.0-dev lib32z1-dev expect gawk \
24
25
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
z4yx's avatar
z4yx committed
26
27
28
29
30
31

ARG PETA_VERSION
ARG PETA_RUN_FILE

RUN locale-gen en_US.UTF-8 && update-locale

32
# Create a Vivado user
z4yx's avatar
bug fix    
z4yx committed
33
RUN adduser --disabled-password --gecos '' vivado && \
34
35
    usermod -aG sudo vivado && \
    echo "vivado ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
z4yx's avatar
z4yx committed
36
37
38

COPY accept-eula.sh ${PETA_RUN_FILE} /

39
# Run the installer
40
RUN chmod a+rx /${PETA_RUN_FILE} && \
41
42
43
44
45
    chmod a+rx /accept-eula.sh && \
    mkdir -p /opt/Xilinx && \
    chmod 777 /tmp /opt/Xilinx && \
    cd /tmp && \
    sudo -u vivado -i /accept-eula.sh /${PETA_RUN_FILE} /opt/Xilinx/petalinux && \
46
    rm -f /${PETA_RUN_FILE} /accept-eula.sh
z4yx's avatar
z4yx committed
47

48
# Make /bin/sh symlink to bash instead of dash:
49
RUN echo "dash dash/sh boolean false" | debconf-set-selections
Steffen Vogel's avatar
Steffen Vogel committed
50
RUN dpkg-reconfigure dash
51

z4yx's avatar
z4yx committed
52
53
USER vivado
ENV HOME /home/vivado
Yuxiang Zhang's avatar
Yuxiang Zhang committed
54
55
56
ENV LANG en_US.UTF-8
RUN mkdir /home/vivado/project
WORKDIR /home/vivado/project
z4yx's avatar
z4yx committed
57

58
# Add vivado tools to path
z4yx's avatar
z4yx committed
59
RUN echo "source /opt/Xilinx/petalinux/settings.sh" >> /home/vivado/.bashrc