Merge pull request #7200 from dokku/6893-enter-without-container-type

Automatically select a container type if none is specified
This commit is contained in:
Jose Diaz-Gonzalez
2024-09-23 21:53:21 -04:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -12,6 +12,9 @@ enter <app> [<container-type> || --container-id <container-id>] # Connect to a
The `enter` command can be used to enter a running container. The following variations of the command exist:
```shell
# enter the first container
dokku enter node-js-app
# enter the web process
dokku enter node-js-app web

View File

@@ -39,7 +39,7 @@ trigger-scheduler-docker-local-scheduler-enter() {
esac
done
if [[ -z "$CONTAINER_ID" ]] && [[ -z "$CONTAINER_TYPE" ]]; then
if [[ -z "$CONTAINER_ID" ]] && [[ -z "$CONTAINER_TYPE" || "$CONTAINER_TYPE" == "--" ]]; then
AVAILABLE_CONTAINER_TYPES=($(get_app_running_container_types "$APP"))
if [[ ${#AVAILABLE_CONTAINER_TYPES[@]} -gt 1 ]]; then
dokku_log_warn "No container type specified."