-
Notifications
You must be signed in to change notification settings - Fork 6
/
rip_docker.sh
executable file
·47 lines (43 loc) · 1.25 KB
/
rip_docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Command-line script to execute ripping using the Docker container.
#
# Many flags are required for the internal /usr/bin/entrypoint script to setup permissions and turn
# off rendering of the app's windows.
#
# TODO: For the common case of batch running, investigate eliminating entrypoint script
# and many of these variables.
set -e
if [ "$#" -ne 2 ]; then
echo "Requires two arguments: name of the Docker image, and path to acquisition top-level directory"
exit -1
fi
if [ ! -d "${2}" ]; then
echo "Directory missing: ${2}"
exit -2
fi
# Flags determined by examining docker-wine with:
# --as-me
# --workdir
# --xvfb
# --name
# https://github.com/scottyhardy/docker-wine/blob/master/docker-wine
docker run \
-it \
--rm \
--volume=${2}:/data \
--env=USER_NAME=${USER} \
--env=USER_UID=$(id -u ${USER}) \
--env=USER_GID=$(id -g ${USER}) \
--env=USER_HOME=${HOME} \
--workdir=/home/${USER} \
--env=USE_XVFB=yes \
--env=XVFB_SERVER=:95 \
--env=XVFB_SCREEN=0 \
--env=XVFB_RESOLUTION=320x240x8 \
--env=DISPLAY=:95 \
--hostname=bruker-ripper \
--name=bruker-ripper \
--shm-size=1g \
--env=TZ=America/Los_Angeles \
${1}