Add MTU propagation docker-shim also to rootless dind runner images
Related to #1201
This commit is contained in:
parent
e7a21cfc53
commit
e5bb130fda
|
|
@ -106,6 +106,10 @@ COPY entrypoint.sh logger.bash rootless-startup.sh update-status /usr/bin/
|
||||||
|
|
||||||
RUN chmod +x /usr/bin/rootless-startup.sh /usr/bin/entrypoint.sh
|
RUN chmod +x /usr/bin/rootless-startup.sh /usr/bin/entrypoint.sh
|
||||||
|
|
||||||
|
# Copy the docker shim which propagates the docker MTU to underlying networks
|
||||||
|
# to replace the docker binary in the PATH.
|
||||||
|
COPY docker-shim.sh /usr/local/bin/docker
|
||||||
|
|
||||||
# Make the rootless runner directory executable
|
# Make the rootless runner directory executable
|
||||||
RUN mkdir /run/user/1000 \
|
RUN mkdir /run/user/1000 \
|
||||||
&& chown runner:runner /run/user/1000 \
|
&& chown runner:runner /run/user/1000 \
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@ COPY entrypoint.sh logger.bash startup.sh update-status /usr/bin/
|
||||||
COPY supervisor/ /etc/supervisor/conf.d/
|
COPY supervisor/ /etc/supervisor/conf.d/
|
||||||
RUN chmod +x /usr/bin/startup.sh /usr/bin/entrypoint.sh
|
RUN chmod +x /usr/bin/startup.sh /usr/bin/entrypoint.sh
|
||||||
|
|
||||||
|
# Copy the docker shim which propagates the docker MTU to underlying networks
|
||||||
|
# to replace the docker binary in the PATH.
|
||||||
|
COPY docker-shim.sh /usr/local/bin/docker
|
||||||
|
|
||||||
# Configure hooks folder structure.
|
# Configure hooks folder structure.
|
||||||
COPY hooks /etc/arc/hooks/
|
COPY hooks /etc/arc/hooks/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,16 @@
|
||||||
|
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
DOCKER=/usr/bin/docker
|
||||||
|
if [ ! -e $DOCKER ]; then
|
||||||
|
DOCKER=$HOME/bin/docker
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${ARC_DOCKER_MTU_PROPAGATION:-false} == true ]] &&
|
if [[ ${ARC_DOCKER_MTU_PROPAGATION:-false} == true ]] &&
|
||||||
(($# >= 2)) && [[ $1 == network && $2 == create ]] &&
|
(($# >= 2)) && [[ $1 == network && $2 == create ]] &&
|
||||||
mtu=$(/usr/bin/docker network inspect bridge --format '{{index .Options "com.docker.network.driver.mtu"}}' 2>/dev/null); then
|
mtu=$($DOCKER network inspect bridge --format '{{index .Options "com.docker.network.driver.mtu"}}' 2>/dev/null); then
|
||||||
shift 2
|
shift 2
|
||||||
set -- network create --opt com.docker.network.driver.mtu="$mtu" "$@"
|
set -- network create --opt com.docker.network.driver.mtu="$mtu" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /usr/bin/docker "$@"
|
exec $DOCKER "$@"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue