docker/jupyter/build/build.fish

76 lines
1.5 KiB
Fish
Raw Normal View History

2022-10-01 17:30:14 -07:00
#!/usr/bin/fish
set img_idx 0
set is_quiet true
set root_dir "."
function build_image
# First argument: remove parent image?
# true or false, optional, default is false
2022-10-01 17:30:14 -07:00
# Second argument: file name to build
# Parse arguments
if test (count $argv) -eq 2
set remove_previous $argv[1]
set build_file $argv[2]
else if test (count $argv) -eq 1
set remove_previous false
2022-10-01 17:30:14 -07:00
set build_file $argv[1]
end
printf "Building $build_file...\n"
docker build $root_dir \
--quiet=$is_quiet \
--build-arg BASE_CONTAINER=betalupi/jupyter-inter-$img_idx \
-f $build_file.Dockerfile \
-t betalupi/jupyter-inter-(math $img_idx + 1)
2022-10-01 19:11:50 -07:00
date "+Finished at %Y-%m-%d %T"
2022-10-01 17:30:14 -07:00
if $remove_previous
printf "Done, cleaning up.\n\n"
sleep 1
docker image rm betalupi/jupyter-inter-$img_idx
else
printf "Done. \n\n"
end
set img_idx (math $img_idx + 1)
end
2022-10-01 19:11:50 -07:00
date "+Build started at %Y-%m-%d %T"
echo ""
2022-10-01 17:30:14 -07:00
# Base image must be built first
2022-10-01 17:30:14 -07:00
printf "Building base image...\n"
2022-10-01 18:21:33 -07:00
docker build \
2022-10-01 17:30:14 -07:00
--quiet=$is_quiet \
2022-11-03 11:01:06 -07:00
--build-arg PYTHON_VERSION=3.10 \
2022-10-01 18:21:33 -07:00
-t betalupi/jupyter-inter-0 \
$root_dir/base
2022-10-01 17:30:14 -07:00
printf "Done. \n\n"
2022-10-09 21:02:49 -07:00
build_image octave
build_image r
build_image julia
#build_image sage (BROKEN)
2022-10-01 17:30:14 -07:00
build_image plugins
build_image pymodules
2022-10-01 17:30:14 -07:00
2022-10-09 21:02:49 -07:00
# Manim will not install under python 3.10.
# 3.9 works (see arguments for base above)
#build_image manim
2022-10-09 21:02:49 -07:00
2022-10-01 17:30:14 -07:00
# Rename final image
2022-10-01 19:11:50 -07:00
docker image tag betalupi/jupyter-inter-(math $img_idx) git.betalupi.com/mark/jupyter
docker image rm betalupi/jupyter-inter-(math $img_idx)
echo ""
2022-10-07 13:48:54 -07:00
date "+Build finished at %Y-%m-%d %T"