# Docker images and containers to create cross compile images.
# You can use a toolchain container to compile source code
# or create a wrapper container and compile the source code in that container.



# First create an image CentOS 7 devel,
# a CentOS 7 including development tools and crosstool-ng.
#
# Build container image centos7-devel:7.4-1
time docker build --tag centos7-devel:7.4-1 .



# Use container image centos7-devel:7.4-1 to build
# a specific cross compile toolchain image.
# Here we build x86_64 a toolchain image.
#
cd x86_64-toolchain
time docker build --tag centos7-x86_64-toolchain:7.4-1 .

cd ..

cd test/test1 # and build wrappercontainer
docker build --tag centos7-crosscompile-x86_64-wrapper:1.0 .

## Example to run this:
# docker run -it --rm -v ~/src/project:/build centos7-crosscompile-x86_64-wrapper:1.0

# docker run -it --rm -v ~/src/project:/build centos7-crosscompile-x86_64-wrapper:1.0 hello

# docker run -it --rm -v ~/src/project:/build centos7-crosscompile-x86_64-wrapper:1.0 clean
