Page MenuHomeVyOS Platform

Building instructions with Docker need a little more detail
Open, Requires assessmentPublic

Description

Today I tried to build the vyos LTS iso using docker. When pulling the crux image from DockerHub, there is no way to follow the instructions, as the configure script cannot be found. The commands I used are below:

root@vyos-build:~# docker pull vyos/vyos-build:crux
crux: Pulling from vyos/vyos-build
Digest: sha256:2fc0d4c2e4aba657f5b79d3b8b28ec20de501274be89157ae9cc13832e0d77e6
Status: Image is up to date for vyos/vyos-build:crux
docker.io/vyos/vyos-build:crux
root@vyos-build:~# docker run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos/vyos-build:crux bash
Current UID/GID: 0/0
root@4714c2f638f4:/vyos# ./configure --architecture amd64 \
>                              --build-by "your@email.tld" \
>                              --build-type release --version 1.2.0
bash: ./configure: No such file or directory

I followed the instructions from the docs: https://docs.vyos.io/en/crux/contributing/build-vyos.html

Details

Difficulty level
Unknown (require assessment)
Version
1.2.5
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

fetzerms created this task.May 18 2020, 3:38 PM
fetzerms created this object in space S1 VyOS Public.
fetzerms updated the task description. (Show Details)

You want to fetch the repo before building; cf. the 'Generating the container section':

git clone -b crux --single-branch https://github.com/vyos/vyos-build

pasik added a subscriber: pasik.May 18 2020, 6:54 PM

Isn't the image published on DockerHub supposed to be equal to building it manually?

thomas-mangin added a subscriber: thomas-mangin.EditedMay 18 2020, 8:30 PM

Last time I generate crux I used the docker current to do it ...
(but I could not this time...)

You want to fetch the repo before building; cf. the 'Generating the container section':
git clone -b crux --single-branch https://github.com/vyos/vyos-build

Just to verify: In case I use the image from DockerHub, I still need to clone vyos-build, start the build-container container inside and run ./configure as well as make iso? I thought that the container from DockerHub substitutes all the steps and comes with the configure script etc. pre-installed.

thomas-mangin added a comment.EditedMay 18 2020, 9:30 PM

ediing vyos make iso -r crux -d
https://github.com/thomas-mangin/vyos-hacker-toolkit

It should be something like this

ssh  -i /Users/thomas/.ssh/thomas@mangin.com/id_rsa.personal -p 22 vyos@10.12.100.12 "rm -rf \$HOME/vyos/vyos-build/packages/*"
cd $HOME/vyos/vyos-build && git fetch
docker run --rm --privileged -v $HOME/vyos/vyos-build:$HOME/vyos/vyos-build -w $HOME/vyos/vyos-build/ vyos/vyos-build:crux git checkout crux
docker run --rm --privileged -v $HOME/vyos/vyos-build:$HOME/vyos/vyos-build -w $HOME/vyos/vyos-build/ vyos/vyos-build:crux ./configure --build-by thomas@mangin.com --debian-mirror http://ftp.de.debian.org/debian/ --version crux-202005190033 --build-type release
docker run --rm --privileged -v $HOME/vyos/vyos-build:$HOME/vyos/vyos-build -w $HOME/vyos/vyos-build/ vyos/vyos-build:crux sudo make iso

But this failed for me .. but I ran of of time to debug it.

runar added a subscriber: runar.May 18 2020, 9:44 PM

The dockerhub image is just an environment capable of generating the vyos image, it does not include any of the files needed to generate the image itself. These files are inside the vyos-build repository.

You need to clone this repository and from within it execute the build container with ./configure.... and make iso to generate a working image.

c-po added a subscriber: c-po.EditedMay 19 2020, 6:02 AM

Yes it is, we auto publish it if there is a change.

Also CI says all good https://ci.vyos.net/job/vyos-build/job/crux/

Let me have a look later today

fetzerms added a comment.EditedMay 19 2020, 3:17 PM

I was able to build 1.2.5 iso (but there is no git tag for it?) with the docker container. I just misunderstood the documentation and thought that the vyos-build-repo is only the repo for the docker image. But it seems the docker image is just from the docker file and the repository needs to be cloned anyways.

The following code worked good for me:

vyos_build_path=/opt/vyos-build/
docker pull vyos/vyos-build:crux
git clone -b crux --single-branch https://github.com/vyos/vyos-build $vyos_build_path
docker run --rm -it --privileged -v $vyos_build_path:/vyos -w /vyos vyos/vyos-build:crux bash -c './configure --architecture amd64 --build-by "vyos@censored" --build-type release --version 1.2.5 && make iso'
c-po added a comment.May 19 2020, 3:53 PM

@fetzerms thanks for getting back to us - I also successfully tested it.

I guess there is always room for improvement in the documentation. Maybe you want to contribute a fix for the missleading parts?

fetzerms added a comment.EditedMay 19 2020, 5:37 PM
In T2474#64078, @c-po wrote:

@fetzerms thanks for getting back to us - I also successfully tested it.
I guess there is always room for improvement in the documentation. Maybe you want to contribute a fix for the missleading parts?

Done. Please review my pull request: https://github.com/vyos/vyos-documentation/pull/255

I also updated the Task title to reflect the actual issue.

fetzerms renamed this task from Crux Image in DockerHub is broken to Bulding instructions with Docker need a little more detail.May 19 2020, 5:38 PM
fetzerms renamed this task from Bulding instructions with Docker need a little more detail to Building instructions with Docker need a little more detail.

I need to double-check (and may not get to it) but if you use a vyos-build to build current and then try to build crux, make iso is not happy. I am now building crux using the command in my post above, the only difference: clean vyos-build install before the git checkout crux.