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

Add LAUNCH_EXT_NETWORKS_IPV4 #26

Merged
merged 3 commits into from
Feb 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ The following environment variables are important if you don't supply a `/docker
| `LAUNCH_SERVICE_NAME` | random (by swarm-launcher) | NO | If you want to use a specific name for the service |
| `LAUNCH_CONTAINER_NAME` | random (by docker) | NO | If you want to use a specific name for the container (similar to the task name) |
| `LAUNCH_HOSTNAME` | - | NO | If you want to use a specific hostname for the container |
| `LAUNCH_IPV4_ADDRESS` | - | NO | If you want to use a specific IPv4 address for the container |
beornf marked this conversation as resolved.
Show resolved Hide resolved
| `LAUNCH_IPV6_ADDRESS` | - | NO | If you want to use a specific IPv6 address for the container |
beornf marked this conversation as resolved.
Show resolved Hide resolved
| `LAUNCH_PRIVILEGED` | `false` | NO | Set this to `true` if you want to start a privileged container |
| `LAUNCH_ENVIRONMENTS` | - | NO | Space separated list of Key=Value pairs. **Note**: `@_@` gets replaced with a single whitespace, so you can expose environment values containing spaces. |
| `LAUNCH_DEVICES` | - | NO | Space separated list of DeviceOnHost:DeviceInContainer |
Expand Down
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ if [ -f ${COMPOSE_FILE} ]; then
'LAUNCH_CONTAINER_NAME'
'LAUNCH_PRIVILEGED'
'LAUNCH_HOSTNAME'
'LAUNCH_IPV4_ADDRESS'
'LAUNCH_IPV6_ADDRESS'
beornf marked this conversation as resolved.
Show resolved Hide resolved
'LAUNCH_ENVIRONMENTS'
'LAUNCH_DEVICES'
'LAUNCH_VOLUMES'
Expand Down Expand Up @@ -256,7 +258,13 @@ xEOF
echo " - ${NETWORK}" >> ${COMPOSE_FILE}
beornf marked this conversation as resolved.
Show resolved Hide resolved
done
for NETWORK in ${LAUNCH_EXT_NETWORKS}; do
echo " - ${NETWORK}" >> ${COMPOSE_FILE}
echo " ${NETWORK}:" >> ${COMPOSE_FILE}
if [ -n "${LAUNCH_IPV4_ADDRESS}" ]; then
echo " ipv4_address: ${LAUNCH_IPV4_ADDRESS}" >> ${COMPOSE_FILE}
beornf marked this conversation as resolved.
Show resolved Hide resolved
fi
if [ -n "${LAUNCH_IPV6_ADDRESS}" ]; then
echo " ipv6_address: ${LAUNCH_IPV6_ADDRESS}" >> ${COMPOSE_FILE}
fi
beornf marked this conversation as resolved.
Show resolved Hide resolved
done
echo "networks:" >> ${COMPOSE_FILE}
for NETWORK in ${LAUNCH_NETWORKS}; do
Expand Down