From fdf8f52e6e815456ec5fc1d0a6fdca4c8e62b7ba Mon Sep 17 00:00:00 2001 From: Hartmut Obendorf Date: Wed, 21 Aug 2024 09:36:20 +0200 Subject: [PATCH] Fix for #169 'snap execution of /usr/bin/ssh fails' https://github.com/canonical/docker-snap/issues/170 added ssh-keys interface added ssh-public-keys interface added openssh-client for staging added bind-file layout for /use/bin/ssh --- snap/snapcraft.yaml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c831476..b6a74de 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: docker #title: Docker -version: '24.0.5' +version: "24.0.5" summary: Docker container runtime description: | Build and run container images with Docker. @@ -47,12 +47,14 @@ layout: bind-file: $SNAP_DATA/etc/gitconfig /usr/libexec/docker/cli-plugins: symlink: $SNAP/usr/libexec/docker/cli-plugins + /usr/bin/ssh: + bind-file: $SNAP/usr/bin/ssh environment: GIT_EXEC_PATH: "$SNAP/usr/lib/git-core" GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates" # For nvidia support # - LD_LIBRARY_PATH: $SNAP/graphics/lib/${CRAFT_ARCH_TRIPLET}:${SNAP}/lib/:${SNAP}/lib/${CRAFT_ARCH_TRIPLET}:${SNAP}/usr/lib/:${SNAP}/usr/lib/${CRAFT_ARCH_TRIPLET} + LD_LIBRARY_PATH: $SNAP/graphics/lib/${CRAFT_ARCH_TRIPLET}:${SNAP}/lib/:${SNAP}/lib/${CRAFT_ARCH_TRIPLET}:${SNAP}/usr/lib/:${SNAP}/usr/lib/${CRAFT_ARCH_TRIPLET} LIBGL_DRIVERS_PATH: $SNAP/graphics/lib/${CRAFT_ARCH_TRIPLET}/dri LIBVA_DRIVERS_PATH: $SNAP/graphics/lib/${CRAFT_ARCH_TRIPLET}/dri # nvidia-container-runtime can only set alternative config directory via XDG_CONFIG_HOME # @@ -104,6 +106,8 @@ apps: - network - home - removable-media + - ssh-keys + - ssh-public-keys dockerd: command: bin/dockerd-wrapper @@ -165,6 +169,13 @@ parts: - jq - pciutils + ssh: + plugin: nil + stage-packages: + - openssh-client + # stage: + # - /usr/bin/ssh + engine: plugin: make source: https://github.com/moby/moby.git @@ -192,7 +203,7 @@ parts: # install docker-proxy previously provided by libnetwork part install -T bundles/dynbinary-daemon/docker-proxy "$CRAFT_PART_INSTALL/bin/docker-proxy" # https://github.com/moby/moby/blob/v24.0.5/Dockerfile.simple (Docker-supported Go version for Engine) - build-snaps: &go ['go/1.20/stable'] + build-snaps: &go ["go/1.20/stable"] # we get weird behavior if we mix/match Go versions throughout this one snapcraft.yml, so we use a YAML reference here to ensure we're always consistent throughout after: [wrapper-scripts] build-packages: @@ -299,7 +310,7 @@ parts: source-tag: v0.19.0 source-depth: 1 organize: - 'usr/local/bin/tini-static': bin/docker-init + "usr/local/bin/tini-static": bin/docker-init build-packages: - build-essential prime: @@ -366,5 +377,4 @@ lint: - library: - usr/lib/**/libltdl.so.* - usr/lib/**/libnvidia-container-go.so.* - # vim:set et ts=2 sw=2: