From ac1a6ff8e00b30e3f298b15574fa890fabb2cac0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sun, 8 Jul 2018 19:33:27 +1000 Subject: [PATCH] Alpine: Fix 'remove' is not an apk command Signed-off-by: Sebastian Schmidt --- libmachine/provision/alpine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmachine/provision/alpine.go b/libmachine/provision/alpine.go index 30c8535191..a66b01cc98 100644 --- a/libmachine/provision/alpine.go +++ b/libmachine/provision/alpine.go @@ -52,7 +52,7 @@ func (provisioner *AlpineProvisioner) Package(name string, action pkgaction.Pack case pkgaction.Install, pkgaction.Upgrade: packageAction = "add" case pkgaction.Remove: - packageAction = "remove" + packageAction = "del" } switch name { @@ -137,7 +137,7 @@ func (provisioner *AlpineProvisioner) Provision(swarmOptions swarm.Options, auth } log.Debug("Add Community repo") - if _, err := provisioner.SSHCommand("if ! apk info docker >/dev/null; then ver=$(awk '{split($1,a,\".\"); print a[1]\".\"a[2]}' /etc/alpine-release); echo \"http://dl-cdn.alpinelinux.org/alpine/v$ver/community\" >> /etc/apk/repositories; apk update; fi"); err != nil { + if _, err := provisioner.SSHCommand("if ! which docker >/dev/null && ! apk info docker >/dev/null; then ver=$(awk '{split($1,a,\".\"); print a[1]\".\"a[2]}' /etc/alpine-release); echo \"http://dl-cdn.alpinelinux.org/alpine/v$ver/community\" >> /etc/apk/repositories; apk update; fi"); err != nil { return err }