DEVenv/Installer/unix_gcc_build.sh

21 lines
610 B
Bash
Raw Normal View History

2022-07-19 01:45:00 +00:00
#!/bin/bash
for gcc_version in "$@"
do
image_name=mostlyportable-gcc-image
container_name=mostlyportable-gcc
docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} . || exit
docker container rm ${container_name} > /dev/null 2>&1
docker create --name ${container_name} ${image_name} || exit
mkdir --parent build || exit
2022-07-19 05:40:33 +00:00
docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/gcc-mostlyportable-${gcc_version} . || exit
2022-07-19 01:45:00 +00:00
docker container rm ${container_name} || exit
done
if [[ $EUID == 0 ]]; then
2022-07-19 05:40:33 +00:00
chown --recursive ${USER} gcc-mostlyportable-*
2022-07-19 01:45:00 +00:00
fi