Dockerfile 1.61 KB
Newer Older
z4yx's avatar
z4yx committed
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
FROM ubuntu:16.04

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

# 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 .

#install dependences:
RUN sed -i.bak s/archive.ubuntu.com/mirror.tuna.tsinghua.edu.cn/g /etc/apt/sources.list && \
  dpkg --add-architecture i386 && apt-get update && apt-get install -y \
  build-essential \
  sudo \
  tofrodos \
  iproute2 \
  gawk \
  net-tools \
  expect \
  libncurses5-dev \
  tftpd \
  libssl-dev \
  flex \
  bison \
  libselinux1 \
  gnupg \
  wget \
  socat \
  gcc-multilib \
  libsdl1.2-dev \
  libglib2.0-dev \
  lib32z1-dev \
  zlib1g:i386 \
Yuxiang Zhang's avatar
Yuxiang Zhang committed
31
  libgtk2.0-0 \
z4yx's avatar
z4yx committed
32
33
34
35
36
37
38
39
40
41
42
43
44
  screen \
  pax \
  diffstat \
  xvfb \
  xterm \
  texinfo \
  gzip \
  unzip \
  cpio \
  chrpath \
  autoconf \
  lsb-release \
  libtool \
Yuxiang Zhang's avatar
Yuxiang Zhang committed
45
  libtool-bin \
z4yx's avatar
z4yx committed
46
  locales \
47
  kmod \
z4yx's avatar
z4yx committed
48
49
50
51
52
53
54
55
  git

ARG PETA_VERSION
ARG PETA_RUN_FILE

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

#make a Vivado user
z4yx's avatar
bug fix    
z4yx committed
56
57
58
RUN adduser --disabled-password --gecos '' vivado && \
  usermod -aG sudo vivado && \
  echo "vivado ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
z4yx's avatar
z4yx committed
59
60
61
62
63
64

COPY accept-eula.sh ${PETA_RUN_FILE} /

# run the install
RUN chmod a+x /${PETA_RUN_FILE} && \
  mkdir -p /opt/Xilinx && \
z4yx's avatar
bug fix    
z4yx committed
65
66
  chmod 777 /tmp /opt/Xilinx && \
  cd /tmp && \
z4yx's avatar
z4yx committed
67
68
69
70
71
  sudo -u vivado /accept-eula.sh /${PETA_RUN_FILE} /opt/Xilinx/petalinux && \
  rm -f /${PETA_RUN_FILE} /accept-eula.sh 

USER vivado
ENV HOME /home/vivado
Yuxiang Zhang's avatar
Yuxiang Zhang committed
72
73
74
ENV LANG en_US.UTF-8
RUN mkdir /home/vivado/project
WORKDIR /home/vivado/project
z4yx's avatar
z4yx committed
75
76
77
78

#add vivado tools to path
RUN echo "source /opt/Xilinx/petalinux/settings.sh" >> /home/vivado/.bashrc