Skip to content

Commit 1bf446f

Browse files
committed
Force install/refresh snapd before installing snapcraft
1 parent fed885a commit 1bf446f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ $CMD $args
6363
EOF
6464
chmod +x /usr/local/bin/docker_commandline.sh
6565

66+
# here we force install/refresh snapd as the deb version may be outdated and
67+
# not support installing the snapcraft base anymore
6668
cat > /etc/systemd/system/docker-exec.service <<EOF
6769
[Unit]
6870
Description=Docker commandline
6971
Wants=snapd.seeded.service
7072
After=snapd.service snapd.socket snapd.seeded.service
7173
7274
[Service]
73-
ExecStartPre=/bin/bash -c '/usr/bin/snap install snapcraft --classic --channel $USE_SNAPCRAFT_CHANNEL < /dev/null'
75+
ExecStartPre=/bin/bash -c '/usr/bin/snap install snapd || /usr/bin/snap refresh snapd && /usr/bin/snap install snapcraft --classic --channel $USE_SNAPCRAFT_CHANNEL < /dev/null'
7476
ExecStart=/usr/local/bin/docker_commandline.sh
7577
Environment="SNAPPY_LAUNCHER_INSIDE_TESTS=true"
7678
Environment="LANG=C.UTF-8"

0 commit comments

Comments
 (0)