-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templatize and fix builders #19
Conversation
The Dockerfile in the -builder directories is exactly the same except for which DISTRO-base it is pulling from. Given this, it makes sense to use a template and populate all of them based on the same template. Signed-off-by: brian avery <[email protected]>
This commit removes the Dockerfiles from the -builder directories and relies on build_containers.sh populating the Dockerfiles from the dockerfiles/templates/Dockerfile.builder. All the files are the same except for which -base distro they pull from. A README is also added to the -builder directories to discourage people from putting Dockerfiles there as the current logic will just overwrite them. Signed-off-by: brian avery <[email protected]>
The Dockerfiles in the -builder directories are now generated from a template. We want git to ignore those so they do not get accidentally checked in. Signed-off-by: brian avery <[email protected]>
runbitbake.py is an executable entry point. We were running it out of /home/yoctouser, but this breaks on redhat derived distributions when we changed the smoke tests to run as the host user id. This commit moves it to a globally accessible location. Signed-off-by: brian avery <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a solid set of changes to me.
@@ -51,6 +51,9 @@ cd - | |||
# can modify the Dockerfile to use whatever REPO is in the environment. | |||
TAG=$DISTRO_TO_BUILD-builder | |||
dockerdir=`find -name $TAG` | |||
# use the builder template to populate the distro specific Dockerfile | |||
cp dockerfiles/templates/Dockerfile.builder $dockerdir/Dockerfile | |||
sed -i "s/DISTRO_TO_BUILD/$DISTRO_TO_BUILD/g" $dockerdir/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the sed & cp, why not
sed "s/DISTRO_TO_BUILD/$DISTRO_TO_BUILD/g" dockerfiles/templates/Dockerfile.builder > $dockerdir/Dockerfile
Probably not worth changing the patch just for this.
@@ -0,0 +1,2 @@ | |||
The Dockerfile for this directory is autogenerated based on dockerfiles/templates/Dockerfile.builder | |||
Do not place an actual Dockerfile here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the -builder directories to the gitignore, that will discourage people from putting Dockerfiles there and help avoid the generated files being added to the repo.
@@ -1,3 +1,4 @@ | |||
dockerfiles/*/*/*-builder/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore my last…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big change. I figured out why all the redhat builders were breaking and didnt want to change each one. In short, this