Skip to content
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

Merged
merged 4 commits into from
Jul 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

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.

workdir=`mktemp --tmpdir -d tmp-$TAG.XXX`

cp -r $dockerdir $workdir
Expand Down
27 changes: 27 additions & 0 deletions dockerfiles/templates/Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DISTRO_TO_BUILD-builder
# Copyright (C) 2015-2017 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

FROM crops/yocto:DISTRO_TO_BUILD-base

USER root
COPY runbitbake.py /home/yoctouser/
RUN chown -R yoctouser /home/yoctouser/ && \
chmod +x /home/yoctouser/runbitbake.py

USER yoctouser

WORKDIR /home/yoctouser
ENTRYPOINT ["/home/yoctouser/runbitbake.py"]