CONTAINER=centos72 ./automation/scripts/containerize make
```
-- WORKDIR: This overrides the path that will be available under the
+- CONTAINER_PATH: This overrides the path that will be available under the
`/build` directory in the container, which is the default path.
```
- WORKDIR=/some/other/path ./automation/scripts/containerize ls
+ CONTAINER_PATH=/some/other/path ./automation/scripts/containerize ls
```
+- CONTAINER_ARGS: Allows you to pass extra arguments to Docker
+ when starting the container.
+
- XEN_CONFIG_EXPERT: If this is defined in your shell it will be
automatically passed through to the container.
of the same version. Override the name value to cause it to name
the container differently on start.
-- EXTRA_CONTAINER_ARGS: Allows you to pass extra arguments to Docker
- when starting the container.
-
Building a container
--------------------
# Figure out the base of what we want as our sources
# by using the top of the git repo
-if [[ -n ${WORKDIR} ]]; then
- WORKDIR="${WORKDIR}"
-else
- WORKDIR=$(git rev-parse --show-toplevel)
+if [[ -z ${CONTAINER_PATH} ]]; then
+ CONTAINER_PATH=$(git rev-parse --show-toplevel)
fi
# Kick off Docker
exec docker run \
${DOCKER_ARGS} \
${SSH_AUTH_SOCK:+-e SSH_AUTH_SOCK="/tmp/ssh-agent/${SSH_AUTH_NAME}"} \
- -v "${WORKDIR}":/build:rw \
+ -v "${CONTAINER_PATH}":/build:rw \
-v "${HOME}/.ssh":/root/.ssh:ro \
${SSH_AUTH_DIR:+-v "${SSH_AUTH_DIR}":/tmp/ssh-agent} \
${XEN_CONFIG_EXPERT:+-e XEN_CONFIG_EXPERT=${XEN_CONFIG_EXPERT}} \
- ${EXTRA_CONTAINER_ARGS} ${name} \
+ ${CONTAINER_ARGS} ${name} \
-${termint}i --rm -- \
${CONTAINER} \
${cmd}