There are several ways to get an VyOS ISO image. Firstly, you can buy subscription, so you will have an access to LTS VyOS ISO images. The LTS images are also available for VyOS contributors or evangelists with perpetual 1-year access. The third option involves building ISO image itself. Building involves cloning VyOS repository with git, taking care of required dependencies and finally compiling from sources. Either you need Debian as a base and manage dependencies manually or you can compile using the docker method and Debian is not needed.
Using the Dockerfile you create your own Docker container that is used to build a VyOS ISO image or other required VyOS packages. The Dockerfile contains some of the most used packages needed to build a VyOS ISO, a qemu image, and several of the submodules.
1. Install Docker CE
We are going to install Docker CE on Ubuntu 18.04.2 LTS (bionic).
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common git
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo systemctl start docker
2. Clone Vyos-build git and Build Docker Image
$ git clone https://github.com/vyos/vyos-build
$ cd vyos-build/docker
$ sudo docker build -t vyos-builder .
$ cd ..
3. Build VyOS ISO
Enter the container.
$ sudo docker run -it --privileged -v $(pwd):/vyos -w="/vyos" vyos-builder bash
When the container is running, you should be at a prompt that looks something like bellow. You should already be in the right directory (Picture 1).
vyos_bld@6b7eb6ed6c88:/vyos$ ls
Picture 1 - Content of /vyos Directory Inside VyOS Container
Start building inside the container. Once bundling is completed, the built ISO 'live-image-amd64.hybrid.iso' is located inside the container in the /vyos/build directory (Picture 2).
vyos_bld@6b7eb6ed6c88:/vyos$ sudo ./configure
vyos_bld@6b7eb6ed6c88:/vyos$ sudo make iso
Picture 2 - Content of /vyos/build Directory Inside VyOS Container
4. Copy ISO Image out of Container into the host OS
Get the build name and the container ID (Picture 3). Run the command below from host OS (Ubuntu).
$ sudo docker ps | awk '{print $1" "$2}'
Picture 3 - Container ID 6b7eb6ed6c88 of Image vyos-builder
Copy the file live-image-amd64.hybrid.iso out of the container from the host OS.
$ sudo docker cp 6b7eb6ed6c88:/vyos/build/live-image-amd64.hybrid.iso /home/$USER/
End.
Great articl I got further with your explanation than the directions provided by the VyOS wiki. I building this on a Windows 10 PC. When I get to the step docker run -it --privileged -v $(pwd):/vyos -w="/vyos" vyos-builder bash
I have to convert the command to "docker run -it --privileged -v %cmd%/vyos -w="/vyos" vyos-builder bash" because Windows does not understand the $pwd, but i get the docker image to load, but no configure file when I do ls.
when I cd out of vyos i am at the root of a typical Linux OS distro but no access to the files in the vyos-build directoy to configure. Help please