Giter Site home page Giter Site logo

docker-vyos's Introduction

docker-vyos

VyOS inside a container for validing config files, playing with the software etc. without the heavyness of a VM.

generating a local docker image for vyos

rolling release

Per the original https://hub.docker.com/r/2stacks/vyos instructions:

sudo apt-get install -y squashfs-tools python-bs4 
curl --output vyos-latest.iso `python vyos-latest.py` # will fetch a rolling release for you 
mkdir unsquashfs
mkdir rootfs
sudo mount -o loop vyos-latest.iso rootfs
sudo unsquashfs -f -d unsquashfs/ rootfs/live/filesystem.squashfs
sudo tar -C unsquashfs -c . | docker import - vyos
sudo umount rootfs

using VMWare Marketplace image

Using your vmware account, fetch the VyOS appliance OVA file

sudo apt-get install -y squashfs-tools p7zip-full
mkdir unsquashfs
mkdir rootfs
tar xvf  vyos-1.2.1.ova
7z x -ooutput_ova  vyos-1.2.1-disk1.vmdk
sudo unsquashfs -f -d unsquashfs/ output_ova/boot/1.2.1/1.2.1.squashfs
sudo tar -C unsquashfs -c . | docker import - vyos

starting a VyOS docker instance

I am providing a docker-compose.yml and some initial config file (config.init), opiniated with DNS and SSH. The config directory will receive the configuration of VyOS as stored in the system.

How does this works ? This docker-compose will use the init as entrypoint of the squashfs image from VyOS to initialize most of VyOS components as the normal iso. The trick is to change vyos-config init script by a simple one that loads the config.init mounted by docker.

docker-compose build
docker-compose up -d

accessing the VyOS prompt

Just running the following command after a couple of seconds to let the initial configuration settle in:

docker-compose exec -u vyos vyos /bin/vbash

Then one can interact with the VyOS prompt as usual

show configuration
configure
set system time-zone Europe/Madrid
commit
save
exit

notes and disclaimer

I did not tested (yet) advanced services like firewall, routing or IPSec. YMMV and you might have to adjust the docker-compose or adjust VyOS code itself for those usage in container mode.

docker-vyos's People

Contributors

ravens avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.