diff options
author | Viacheslav Hletenko <seversss265@gmail.com> | 2024-01-08 21:44:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 21:44:39 +0200 |
commit | d50d61bfa475947e14e93e324c2103fa7929fda2 (patch) | |
tree | 4a0ed901e8e72e6306dcdb2d3e04b4aad3f91976 | |
parent | d769ed131a711245973958958b1114b179c06b93 (diff) | |
parent | f1ae04aba8b95e5033e5ecc3c2549354c240d95b (diff) | |
download | vyos-vm-images-d50d61bfa475947e14e93e324c2103fa7929fda2.tar.gz vyos-vm-images-d50d61bfa475947e14e93e324c2103fa7929fda2.zip |
Merge pull request #44 from sever-sever/docker
Add Dockerfile and examples
-rw-r--r-- | Dockerfile | 37 | ||||
-rw-r--r-- | README.md | 21 |
2 files changed, 57 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c524878 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:11.8 + +# Install minimal dependencies +RUN apt-get update && apt-get install -y \ + ansible \ + python3 + +# Install required packages (from ansible role "install-packages") +RUN apt-get update && apt-get install -y \ + gdisk \ + kpartx \ + dosfstools \ + e2fsprogs \ + gnupg \ + qemu-utils \ + python3-lxml \ + grub-efi-amd64 \ + grub-efi-amd64-bin \ + grub-common \ + isolinux \ + python3-requests \ + rsync \ + unzip \ + zlib1g-dev \ + squashfs-tools \ + xorriso + +# Install not required dependencies +RUN apt-get install -y \ + git \ + mc \ + nano \ + && rm -rf /var/lib/apt/lists/* + +# Make build directory +RUN mkdir -p /home/build +WORKDIR /home/build @@ -22,7 +22,26 @@ All other requirements will be installed by ansible-playbook. ## Prepare -You need to copy the ISO image with VyOS to /tmp/vyos.iso before running ansible-playbook. Resulting images also will be located inside /tmp/ directory. +You need to copy the ISO image with VyOS to `/tmp/vyos.iso` before running ansible-playbook. Resulting images also will be located inside `/tmp/` directory. + +### Docker +The Dockerfile has all required dependencies. +1. Download the `Dockerfile` +``` +wget https://raw.githubusercontent.com/vyos/vyos-vm-images/current/Dockerfile +``` +2. Build local image with name `vyos-vm-images` (only if you do not have it) +``` +docker build --tag vyos-vm-images:latest -f ./Dockerfile . +``` +3. Start and connect to the container: +```shell +docker run --rm -it --privileged -v $(pwd):/vm-build -v $(pwd)/images:/images -w /vm-build vyos-vm-images:latest bash +``` +4. Clone repo +``` +git clone https://github.com/vyos/vyos-vm-images.git && cd vyos-vm-images +``` ## Supported Platforms |