forked from z4yx/vivado-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (46 loc) · 1.66 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
FROM ubuntu:18.04
MAINTAINER z4yx <[email protected]>
# build with docker build --build-arg VIVADO_VERSION=2018.1 --build-arg VIVADO_TAR_FILE=Xilinx_Vivado_SDK_2018.1_0405_1.tar.gz -t vivado:2018.1 .
ARG UBUNTU_MIRROR=mirror.tuna.tsinghua.edu.cn
#install dependences for:
# * downloading Vivado (wget)
# * xsim (gcc build-essential to also get make)
# * MIG tool (libglib2.0-0 libsm6 libxi6 libxrender1 libxrandr2 libfreetype6 libfontconfig)
# * CI (git)
RUN sed -i.bak s/archive.ubuntu.com/${UBUNTU_MIRROR}/g /etc/apt/sources.list && \
apt-get update && apt-get install -y \
build-essential \
sudo \
libxtst6 \
libglib2.0-0 \
libsm6 \
libxi6 \
libxrender1 \
libxrandr2 \
libfreetype6 \
libfontconfig \
lsb-release \
git
ARG VIVADO_VERSION
ARG VIVADO_TAR_FILE
RUN mkdir /install_vivado
COPY install_config.txt /
# ADD does the extraction
ADD ${VIVADO_TAR_FILE} /install_vivado/
# run the install
RUN ls /install_vivado && /install_vivado/*/xsetup --agree 3rdPartyEULA,WebTalkTerms,XilinxEULA --batch Install --config /install_config.txt && \
rm -rf /${VIVADO_TAR_FILE} /install_config.txt /install_vivado
#make a Vivado user
RUN adduser --disabled-password --gecos '' vivado &&\
usermod -aG sudo vivado &&\
echo "vivado ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER vivado
WORKDIR /home/vivado
ENV HOME /home/vivado
ENV VIVADO_VERSION ${VIVADO_VERSION}
#add vivado tools to path
RUN echo "source /opt/Xilinx/Vivado/${VIVADO_VERSION}/settings64.sh" >> /home/vivado/.bashrc
#copy in the license file
#RUN mkdir /home/vivado/.Xilinx
#COPY Xilinx.lic /home/vivado/.Xilinx/
CMD ["sh","-c","exec /opt/Xilinx/Vivado/${VIVADO_VERSION}/bin/vivado"]