Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update run_docker.sh #365

Open
wants to merge 2 commits into
base: docbook-prince
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions run_docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo -e "\n\nIf the first argument is '-v', then the following argument should be an extra directory to mount, for use with the ./cll_build -a or -A options, or 'none'."
echo "Syntax is of docker's -v option, so to mount ~/www on /tmp/www, do: ~/www:/tmp/www"
echo "Syntax is of podman's -v option, so to mount ~/www on /tmp/www, do: ~/www:/tmp/www"
echo -e "\nAll other arguments are passed to ./cll_build\n\n"
sleep 1

Expand All @@ -13,21 +13,21 @@ then
shift
fi

sudo docker kill cll_build
sudo docker rm cll_build
sudo podman kill cll_build
sudo podman rm cll_build

dir=$(readlink -f $(dirname $0))

# Make it accessible to both the user and the container
chcon -R -t container_home_t .

# FOR TESTING; forces complete docker rebuild
# sudo docker build --no-cache -t lojban/cll_build -f Dockerfile .
# sudo docker rmi lojban/cll_build
sudo docker build -t lojban/cll_build -f Dockerfile . || {
# FOR TESTING; forces complete podman rebuild
# sudo podman build --no-cache -t lojban/cll_build -f Dockerfile .
# sudo podman rmi lojban/cll_build
sudo podman build -t lojban/cll_build -f Dockerfile . || {
echo "Docker build failed."
exit 1
}
sudo /bin/docker run --name cll_build --log-driver syslog --log-opt tag=cll_build \
sudo /bin/podman run --name cll_build --log-driver syslog --log-opt tag=cll_build \
-v $dir:/srv/cll $extra_dir -it lojban/cll_build \
/tmp/docker_init.sh "$(id -u)" "$(id -g)" "$@"