diff --git a/README.md b/README.md index 90fb70a..dbdfb60 100644 --- a/README.md +++ b/README.md @@ -102,19 +102,19 @@ See [https://github.com/dodevops/kc](the kc website) for details. ## Usage -*CloudControl* can be used best with docker-compose. Check out the `sample` directory in a flavour for a sample +*CloudControl* can be used best with `docker compose`. Check out the `sample` directory in a flavour for a sample compose file and to convenience scripts. It includes a small web server written in Go and Vuejs-client dubbed "CloudControlCenter", which is used as a status screen. It listens to port 8080 inside the container. Copy the compose file and configure it to your needs. Check below for configuration options per flavour and feature. -Run `init.sh`. This script basically just runs `docker-compose up -d` and tells you the URL for CloudControlCenter. +Run `init.sh`. This script basically just runs `docker compose up -d` and tells you the URL for CloudControlCenter. Open it and wait for *CloudControl* to finish initializing. The initialization process will download and configure the additional tools and completes with a message when its done. It will run each time when the stack is recreated. -After the initialization process you can simply run `docker-compose exec cli /usr/local/bin/cloudcontrol run` to jump +After the initialization process you can simply run `docker compose exec cli /usr/local/bin/cloudcontrol run` to jump into the running container and work with the installed features. If you need to change any of the configuration environment variables, rerun the init script afterwards to apply @@ -178,7 +178,7 @@ provided base images for all architectures (e.g. the Apple ARM-based processors) for the available platforms per flavour. As a workaround this, you can use the [`platform`](https://docs.docker.com/compose/compose-file/compose-file-v2/#platform) -parameter for docker-compose or the `--platform` parameter for `docker run` to specify a compatible architecture +parameter for `docker compose` or the `--platform` parameter for `docker run` to specify a compatible architecture (e.g. linux/amd64 on Apple ARM-based machines). ### How can I add an informational text for users of *CloudControl*? @@ -191,8 +191,8 @@ set the environment variable `MOTD_DISPLAY_DEFAULT` to *yes*. If you'd like to forward traffic into a cluster using `kubectl port-forward` you can do the following: -* Add a ports key to the cli-service in your docker-compose file to forward a free port on your host to a defined -port in your container. The docker-compose-files in the sample directories already use port 8081 for this. +* Add a ports key to the cli-service in your docker-compose.yaml file to forward a free port on your host to a defined +port in your container. The docker-compose.yaml-files in the sample directories already use port 8081 for this. * Inside *CloudControl*, check the IP of the container: @@ -218,7 +218,7 @@ kubectl port-forward --address 172.21.0.2 svc/my-service 8081:8080 * Check out, which host port docker bound to the private port you set up (e.g. 8081) ``` -docker-compose port cli 8081 +docker compose port cli 8081 ``` * Connect to localhost:[host port] on your host @@ -239,7 +239,7 @@ Also, to not enter your passphrase every time you use the key, you should mount container and set the environment variable SSH_AUTH_SOCK to that path. *CloudControl* will automatically fix the permissions of that file so the *CloudControl* user can use it. -Here are snippets for your docker-compose file for convenience: +Here are snippets for your docker-compose.yaml file for convenience: (...) volumes: @@ -271,15 +271,14 @@ messages look like this: It's hard to identify from that who the other *CloudControl* user is, that may have opened a lock. The system user can't be changed, but it's possible to set a better hostname than the one Docker autogenerated. -See this docker-compose snippet on how to set a better hostname: +See this docker-compose.yaml snippet on how to set a better hostname: - version: "3" services: - cli: - image: "dodevops/cloudcontrol-azure:latest" - hostname: "[TODO yourname]" - volumes: - (...) + cli: + image: "dodevops/cloudcontrol-azure:latest" + hostname: "[TODO yourname]" + volumes: + (...) If you set hostname in that snippet to "alice", the state lock will look like this now: @@ -313,7 +312,7 @@ Use the `docker logs` command with the failed container to see the complete log installation. If you are really stuck, you can convince the container to keep running by setting "CONTINUE_ON_ERROR=yes" as an -environment variable in the docker-compose file. Then you can debug with the running container. +environment variable in the docker-compose.yaml file. Then you can debug with the running container. ## Flavours diff --git a/README.md.gotmpl b/README.md.gotmpl index fa69fd9..eb9e681 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -39,19 +39,19 @@ Following features and tools are supported: ## Usage -*CloudControl* can be used best with docker-compose. Check out the `sample` directory in a flavour for a sample +*CloudControl* can be used best with `docker compose`. Check out the `sample` directory in a flavour for a sample compose file and to convenience scripts. It includes a small web server written in Go and Vuejs-client dubbed "CloudControlCenter", which is used as a status screen. It listens to port 8080 inside the container. Copy the compose file and configure it to your needs. Check below for configuration options per flavour and feature. -Run `init.sh`. This script basically just runs `docker-compose up -d` and tells you the URL for CloudControlCenter. +Run `init.sh`. This script basically just runs `docker compose up -d` and tells you the URL for CloudControlCenter. Open it and wait for *CloudControl* to finish initializing. The initialization process will download and configure the additional tools and completes with a message when its done. It will run each time when the stack is recreated. -After the initialization process you can simply run `docker-compose exec cli /usr/local/bin/cloudcontrol run` to jump +After the initialization process you can simply run `docker compose exec cli /usr/local/bin/cloudcontrol run` to jump into the running container and work with the installed features. If you need to change any of the configuration environment variables, rerun the init script afterwards to apply @@ -115,7 +115,7 @@ provided base images for all architectures (e.g. the Apple ARM-based processors) for the available platforms per flavour. As a workaround this, you can use the [`platform`](https://docs.docker.com/compose/compose-file/compose-file-v2/#platform) -parameter for docker-compose or the `--platform` parameter for `docker run` to specify a compatible architecture +parameter for `docker compose` or the `--platform` parameter for `docker run` to specify a compatible architecture (e.g. linux/amd64 on Apple ARM-based machines). ### How can I add an informational text for users of *CloudControl*? @@ -128,8 +128,8 @@ set the environment variable `MOTD_DISPLAY_DEFAULT` to *yes*. If you'd like to forward traffic into a cluster using `kubectl port-forward` you can do the following: -* Add a ports key to the cli-service in your docker-compose file to forward a free port on your host to a defined -port in your container. The docker-compose-files in the sample directories already use port 8081 for this. +* Add a ports key to the cli-service in your docker-compose.yaml file to forward a free port on your host to a defined +port in your container. The docker-compose.yaml-files in the sample directories already use port 8081 for this. * Inside *CloudControl*, check the IP of the container: @@ -155,7 +155,7 @@ kubectl port-forward --address 172.21.0.2 svc/my-service 8081:8080 * Check out, which host port docker bound to the private port you set up (e.g. 8081) ``` -docker-compose port cli 8081 +docker compose port cli 8081 ``` * Connect to localhost:[host port] on your host @@ -176,7 +176,7 @@ Also, to not enter your passphrase every time you use the key, you should mount container and set the environment variable SSH_AUTH_SOCK to that path. *CloudControl* will automatically fix the permissions of that file so the *CloudControl* user can use it. -Here are snippets for your docker-compose file for convenience: +Here are snippets for your docker-compose.yaml file for convenience: (...) volumes: @@ -208,15 +208,14 @@ messages look like this: It's hard to identify from that who the other *CloudControl* user is, that may have opened a lock. The system user can't be changed, but it's possible to set a better hostname than the one Docker autogenerated. -See this docker-compose snippet on how to set a better hostname: +See this docker-compose.yaml snippet on how to set a better hostname: - version: "3" services: - cli: - image: "dodevops/cloudcontrol-azure:latest" - hostname: "[TODO yourname]" - volumes: - (...) + cli: + image: "dodevops/cloudcontrol-azure:latest" + hostname: "[TODO yourname]" + volumes: + (...) If you set hostname in that snippet to "alice", the state lock will look like this now: @@ -250,7 +249,7 @@ Use the `docker logs` command with the failed container to see the complete log installation. If you are really stuck, you can convince the container to keep running by setting "CONTINUE_ON_ERROR=yes" as an -environment variable in the docker-compose file. Then you can debug with the running container. +environment variable in the docker-compose.yaml file. Then you can debug with the running container. ## Flavours diff --git a/ccc-client/src/components/MainScreen.vue b/ccc-client/src/components/MainScreen.vue index 6e4d6a6..fcedc8d 100644 --- a/ccc-client/src/components/MainScreen.vue +++ b/ccc-client/src/components/MainScreen.vue @@ -11,11 +11,11 @@

CloudControl has been initialized. Run the following to enter the container:

- docker-compose exec cli /usr/local/bin/cloudcontrol run + docker compose exec cli /usr/local/bin/cloudcontrol run diff --git a/contrib/cloudcontrol-host/cloudcontrol b/contrib/cloudcontrol-host/cloudcontrol index 8849c4e..82a999e 100644 --- a/contrib/cloudcontrol-host/cloudcontrol +++ b/contrib/cloudcontrol-host/cloudcontrol @@ -31,25 +31,25 @@ then then echo "Reinitializing ${CONTEXT} CLOUDCONTROL" echo "Please use Ctrl-C after the initialization has finished and then rerun cc" - docker-compose down + docker compose down bash init.sh elif [ "${SELECTEDMENU}" == "ccc" ] then - CCC_PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) + CCC_PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "Starting CloudControlCenter on port ${CCC_PORT} for ${CONTEXT}" open "http://localhost:${CCC_PORT}" elif [ "${SELECTEDMENU}" == "stop" ] then - docker-compose stop + docker compose stop elif [ "${SELECTEDMENU}" == "down" ] then - docker-compose down + docker compose down fi else # Enter CloudControl context echo "Entering ${CONTEXT} CLOUDCONTROL" - docker-compose up -d - docker-compose exec cli /usr/local/bin/cloudcontrol run + docker compose up -d + docker compose exec cli /usr/local/bin/cloudcontrol run fi fi diff --git a/flavour/aws/sample/docker-compose.yaml b/flavour/aws/sample/docker-compose.yaml index 1bbf21b..d570cdd 100644 --- a/flavour/aws/sample/docker-compose.yaml +++ b/flavour/aws/sample/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3" services: cli: image: "ghcr.io/dodevops/cloudcontrol-aws:latest" diff --git a/flavour/aws/sample/init.sh b/flavour/aws/sample/init.sh index 62905dc..225d2ce 100644 --- a/flavour/aws/sample/init.sh +++ b/flavour/aws/sample/init.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d -PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) +PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "CloudControl is initializing. Check out http://localhost:${PORT} for details" diff --git a/flavour/azure/sample/docker-compose.yaml b/flavour/azure/sample/docker-compose.yaml index 9722def..f96e62e 100644 --- a/flavour/azure/sample/docker-compose.yaml +++ b/flavour/azure/sample/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3" services: cli: image: "ghcr.io/dodevops/cloudcontrol-azure:latest" diff --git a/flavour/azure/sample/init.sh b/flavour/azure/sample/init.sh index df13cbc..8ed912c 100644 --- a/flavour/azure/sample/init.sh +++ b/flavour/azure/sample/init.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d -PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) +PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "CloudControl is initializing. Check out http://localhost:${PORT} for details" diff --git a/flavour/gcloud/sample/docker-compose.yaml b/flavour/gcloud/sample/docker-compose.yaml index a50afb8..8c95077 100644 --- a/flavour/gcloud/sample/docker-compose.yaml +++ b/flavour/gcloud/sample/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3" services: cli: volumes: diff --git a/flavour/gcloud/sample/init.sh b/flavour/gcloud/sample/init.sh index df13cbc..8ed912c 100644 --- a/flavour/gcloud/sample/init.sh +++ b/flavour/gcloud/sample/init.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d -PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) +PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "CloudControl is initializing. Check out http://localhost:${PORT} for details" diff --git a/flavour/simple/sample/docker-compose.yaml b/flavour/simple/sample/docker-compose.yaml index 09803d1..d437e63 100644 --- a/flavour/simple/sample/docker-compose.yaml +++ b/flavour/simple/sample/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3" services: cli: image: "ghcr.io/dodevops/cloudcontrol-simple:latest" diff --git a/flavour/simple/sample/init.sh b/flavour/simple/sample/init.sh index df13cbc..8ed912c 100644 --- a/flavour/simple/sample/init.sh +++ b/flavour/simple/sample/init.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d -PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) +PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "CloudControl is initializing. Check out http://localhost:${PORT} for details" diff --git a/flavour/tanzu/sample/docker-compose.yaml b/flavour/tanzu/sample/docker-compose.yaml index 948e535..e5c9029 100644 --- a/flavour/tanzu/sample/docker-compose.yaml +++ b/flavour/tanzu/sample/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "3" services: cli: image: "ghcr.io/dodevops/cloudcontrol-tanzu:latest" diff --git a/flavour/tanzu/sample/init.sh b/flavour/tanzu/sample/init.sh index df13cbc..8ed912c 100644 --- a/flavour/tanzu/sample/init.sh +++ b/flavour/tanzu/sample/init.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -docker-compose pull -docker-compose up -d +docker compose pull +docker compose up -d -PORT=$(docker-compose port cli 8080 | cut -d ":" -f 2) +PORT=$(docker compose port cli 8080 | cut -d ":" -f 2) echo "CloudControl is initializing. Check out http://localhost:${PORT} for details" diff --git a/internal/backend.go b/internal/backend.go index 24a26bb..fe7535d 100644 --- a/internal/backend.go +++ b/internal/backend.go @@ -2,14 +2,15 @@ package internal import ( "fmt" - "github.com/sirupsen/logrus" - "gopkg.in/yaml.v3" "os" "os/exec" "path/filepath" "regexp" "sort" "strings" + + "github.com/sirupsen/logrus" + "gopkg.in/yaml.v3" ) // Feature describes a feature in the filesystem @@ -161,7 +162,7 @@ func (backend *Backend) initialization() func() { logrus.Info("Finished initialization") logrus.Info("Please run the following to enter CloudControl") - logrus.Info("docker-compose exec cli /usr/local/bin/cloudcontrol run") + logrus.Info("docker compose exec cli /usr/local/bin/cloudcontrol run") backend.Status = "INITIALIZED" }