...
A typical build command could look like this:
Code Block language bash title Build Command linenumbers true #!/bin/sh IMAGE_NAME="agent-1-13-4445" docker build --no-cache --rm --tag=$IMAGE_NAME --file=./build/Dockerfile --build-arg="USER_ID=$UID" ./build
...
A typical run command could look like this:
Code Block language bash title Run Command linenumbers true #!/bin/sh IMAGE_NAME="agent-1-13-4445" RUN_USER_ID="$(id -u $USER):$(id -g $USER)" mkdir -p /some/path/logs docker run -dit --rm --user=$RUN_USER_ID --hostname=$IMAGE_NAME --network=js --publish=5445:4445 --volume=/some/path/logs:/var/sos-berlin.com/jobscheduler_agent/var_4445/logs:Z --name=$IMAGE_NAME $IMAGE_NAME
- Explanations
- Using a common network for JobScheduler components allows direct access to resources such as ports within the network.
- The
RUN_USER_ID
variable is populated with the numeric ID of the account and the group that executes the run command. This value is assigned the--user
option in order to inject the account information into the container (replacing the account specified with theUSE jobscheduler
instruction in the Dockerfile. - Port 4445 for access to JobScheduler Agent by a Master can optionally be mapped to some outside port. This is not required if a network is used.
- Specify a
logs
directory to be created that is referenced with the--volume
option to expose the log directory of the JobScheduler Agent for reading. Avoid to modify log files in this directory and to add new files.
...