CS110L-Lab/proj-1/deet/container
2020-10-07 15:58:20 -07:00

24 lines
774 B
Bash
Executable File

#! /bin/bash
# Kill the existing deet container if one is running
docker rm -f deet &>/dev/null
# Start a container
docker run \
`# Give the container a name (so that it's easier to attach to with "docker exec")` \
--name deet \
`# Mount the current directory inside of the container, so cargo can access it` \
-v "${PWD}":/deet \
`# Set the container user's home directory to our deet directory` \
-e HOME=/deet \
`# Run as the current user (instead of root)` \
-u $(id -u ${USER}):$(id -g ${USER}) \
`# Allow ptrace` \
--cap-add=SYS_PTRACE \
`# When the container exits, automatically clean up the files it leaves behind` \
--rm \
`# Get an interactive terminal` \
-it \
`# Run the deet image` \
deet "$@"