Skip to content

Commit

Permalink
Update the PATH containerd-shims has to find runc (#2772)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsakalozos authored Dec 2, 2021
1 parent 0a06190 commit c22142a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion microk8s-resources/wrappers/run-containerd-with-args
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ if [ -d /sys/kernel/security/apparmor ] && [ "$(cat /proc/self/attr/current)" !=
exec aa-exec -p unconfined -- "$0" "$@"
fi

export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
# Why we put the /snap/microk8s/current in the path?
# containerd-shims need to call runc. They inherit their PATH from containerd.
# As the snap refreshes runc changes location, eg moves from
# /snap/microk8s/123/usr/bin/runc to /snap/microk8s/124/usr/runc.
# containerd-shims need to look for runc in /snap/microk8s/current/usr/bin/runc
SNAP_CURRENT="/snap/microk8s/current"
CURRENT_PATH="$SNAP_CURRENT/usr/sbin:$SNAP_CURRENT/usr/bin:$SNAP_CURRENT/sbin:$SNAP_CURRENT/bin"
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$CURRENT_PATH:$PATH"
ARCH="$($SNAP/bin/uname -m)"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/$ARCH-linux-gnu:$SNAP/usr/lib/$ARCH-linux-gnu"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
Expand Down

0 comments on commit c22142a

Please sign in to comment.