| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | function cleanscip-shell shell shell-project 0.0.0 clean().() { |
| 6 | docker rmi $(catscip-shell system . . cat. $iidfile) |
| 7 | } |
| 8 | |
| 9 | iidfile=$(mktempscip-shell system . . mktemp. -t docker-iidfile.XXXXXXXXXX) |
| 10 | DOCKER_BUILDKIT=1 docker build --iidfile $iidfile --build-arg BUILDKIT_DEBUG --target dev-env . |
| 11 | |
| 12 | trap clean EXIT |
| 13 | SSH= |
| 14 | if [scip-shell system . . `[`. -n "$MOUNT_SSH_AUTH_SOCK" ]; then |
| 15 | SSH="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK" |
| 16 | fi |
| 17 | |
| 18 | volumes= |
| 19 | if [scip-shell system . . `[`. -n "$MOUNT_BUILDKIT_SOURCE" ]; then |
| 20 | volumes="-v $(pwdscip-shell system . . pwd.):/src" |
| 21 | fi |
| 22 | |
| 23 | config= |
| 24 | if [scip-shell system . . `[`. -n "$MOUNT_BUILDKIT_DOCKER_CONFIG_PATH" ]; then |
| 25 | if [scip-shell system . . `[`. -f "$MOUNT_BUILDKIT_DOCKER_CONFIG_PATH" ]; then |
| 26 | config="-v $MOUNT_BUILDKIT_DOCKER_CONFIG_PATH:/root/.docker/config.json:ro" |
| 27 | fi |
| 28 | fi |
| 29 | |
| 30 | set -x |
| 31 | docker run $SSH $volumes $config -it --privileged -v /tmpscip-shell filesystem . . `/tmp`. -e BUILDKIT_REGISTRY_MIRROR_DIR=/root/.cache/registryscip-shell filesystem . . `/root/.cache/registry`. --rm $(catscip-shell system . . cat. $iidfile) ash |