From 53ef6d3032ecb8acd8d05ef38c1a574f71029869 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Mon, 18 Jul 2022 16:43:29 +0200 Subject: [PATCH] docker.mk: dont change context persistently --- docker.mk | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docker.mk b/docker.mk index 2f1ce84..37fb44e 100644 --- a/docker.mk +++ b/docker.mk @@ -26,8 +26,7 @@ post-deploy-docker: pull-compose: @- echo "\n### pulling image(s)" @- $(foreach ctx,$(DEPLOY_HOSTS), \ - docker context use $(ctx); \ - docker pull $(DOCKER_IMAGE); \ + docker --context $(ctx) pull $(DOCKER_IMAGE); \ ) pull-swarm: @@ -35,8 +34,7 @@ pull-swarm: start-compose: @- echo "\n### starting service(s)" @- $(foreach ctx,$(DEPLOY_HOSTS), \ - docker context use $(ctx); \ - docker-compose up -d; \ + docker-compose --host $(ctx) up -d; \ ) start-swarm: @@ -48,8 +46,7 @@ start-swarm: stop-compose: @- echo "\n### stopping service(s)" @- $(foreach ctx,$(DEPLOY_HOSTS), \ - docker context use $(ctx); \ - docker-compose down; \ + docker-compose --host $(ctx) down; \ ) stop-swarm: @@ -60,18 +57,15 @@ stop-swarm: logs-compose: @- echo "\n### logs" - @- docker context use $(host) - @- docker-compose logs -f $(service) + @- docker-compose --host $(ctx) logs -f $(service) logs-swarm: @- echo "\n### logs" - @- docker context use $(DEPLOY_HOSTS) - @- docker service logs -f $(service) + @- docker --context $(ctx) service logs -f $(service) restart-compose: @- $(foreach ctx,$(DEPLOY_HOSTS), \ - docker context use $(ctx); \ - docker-compose restart; \ + docker-compose --host $(ctx) restart; \ ) reload-compose: