Vivado Docker Environment
This repository provides a Docker-based Vivado build and simulation environment. It is designed for:
- Running Vivado without polluting the host system
- Simulating HDL with
ghdl, andcocotb - Automatically cloning the project repository inside the container (Not yet working, we still need to handle the SSH key properly)
- Handling private Git access securely (via SSH key mount or agent forwarding)
๐ Documentation & References
- Vivado Installation Notes (UG973)
- Vivado Silent Install Guide
- Vivado Known Issues
- Vivado Implementation Crash Debug Guide
โ๏ธ Prerequisites
- Docker and Docker Compose installed.
- Access to:
- Vivado installer files (
xsetup,install_config.txt) - Git repository
- Vivado installer files (
- A deploy SSH key with read-only access to your repo.
- Store it as
deploy_keyin the project root. - Ensure proper permissions:
chmod 600 deploy_key
- Store it as
๐ Build the Container
To build without cache (recommended after Dockerfile changes):
docker compose build --no-cache
To rebuild normally:
docker compose build
๐ฆ Vivado Installation in Docker
Vivado is installed inside the container in /opt/Xilinx.
-
Prepare the Vivado installer folder
Placexsetupandinstall_config.txtin the directory specified by.env:Example
.env:VIVADO_INSTALLER_PATH=/path/to/vivado/installerNote that this is inside the host.
-
Run Vivado installer in container:
docker compose run --user=root vivado_installer /usr/local/bin/install_vivado.shThis uses:
./xsetup -a XilinxEULA,3rdPartyEULA -b Install -c ./install_config.txt -
Vivado installation is cached in a named Docker volume (
vivado_opt) so it persists across container rebuilds.
๐ Cloning Private Repos in Docker
Option 1 โ Deploy Key (recommended)
Mount a deploy key into /run/secrets/deploy_key (read-only):
docker-compose.yml:
volumes:
- ./deploy_key:/run/secrets/deploy_key:ro
The clone_repo.sh script will:
- Install the key into
/home/vivado/.ssh/id_ed25519 - Add
github.com/gitlab.com/ corporate host toknown_hosts - Clone or update the repo
Run:
docker compose run --rm vivado_installer
Option 2 โ SSH Agent Forwarding
If running from Linux/WSL2, forward your SSH agent:
export SSH_AUTH_SOCK=$(ssh-agent -s)
docker compose run -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK -v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK vivado_installer
๐ฅ Running the Environment
Start a container (Zsh shell):
docker compose run --rm vivado_installer
This will:
- Install Vivado if needed
- Clone/update your project repo
- Drop you into
/home/vivadoasvivadouser
๐งช Example: Running a Simulation
Inside the container:
cd ~/tich/sim/cocotb/tests
python test_i2c_sniffer.py
๐งน Cleanup
Remove volumes (Vivado install + repo):
docker compose down -v
๐ Notes
- Never bake private keys into the Docker image; always mount them at runtime.
- To avoid Zsh new-user prompts, a minimal
.zshrcis provided in the image:export PATH="$PATH" - Vivado install is large; ensure enough space in your Docker volumes.