Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dokku run do not supports interactive mode. #3739

Merged
merged 2 commits into from
Nov 5, 2019
Merged

dokku run do not supports interactive mode. #3739

merged 2 commits into from
Nov 5, 2019

Conversation

safeforge
Copy link
Contributor

After !3687 I discovered is not possible anymore to use command dokku run in the interactive mode. e.g. using bash

The error seems to be related with the docker command. The command docker run accepts the flags --interactive which permits to keep STDIN/STDOUT opened. Instead --interactive param in the docker create command seems to have a different behaviour, indeed docker start accepts --interactive param as well.

The PR appends the param --interactive to docker start command.

vagrant@dokku:~$ dokku --version
dokku version 0.19.2
vagrant@dokku:~$ dokku apps:create test-app
-----> Creating test-app... done
vagrant@dokku:~$ docker pull alpine:latest
latest: Pulling from library/alpine
9d48c3bd43c5: Pull complete
Digest: sha256:72c42ed48c3a2db31b7dafe17d275b634664a708d901ec9fd57b1529280f01fb
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
vagrant@dokku:~$ docker tag alpine:latest dokku/test-app:latest
vagrant@dokku:~$ dokku run test-app sh
/ # ls -la
vagrant@dokku:~$ dokku --version
dokku version 0.18.5
vagrant@dokku:~$ dokku apps:create test-app
-----> Creating test-app... done
vagrant@dokku:~$ docker pull alpine:latest
latest: Pulling from library/alpine
9d48c3bd43c5: Pull complete
Digest: sha256:72c42ed48c3a2db31b7dafe17d275b634664a708d901ec9fd57b1529280f01fb
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
vagrant@dokku:~$ docker tag alpine:latest dokku/test-app:latest
vagrant@dokku:~$ dokku run test-app sh
/ # ls -la
total 64
drwxr-xr-x    1 root     root          4096 Oct 19 09:53 .
drwxr-xr-x    1 root     root          4096 Oct 19 09:53 ..
-rwxr-xr-x    1 root     root             0 Oct 19 09:53 .dockerenv
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 bin
drwxr-xr-x    5 root     root           360 Oct 19 09:54 dev
drwxr-xr-x    1 root     root          4096 Oct 19 09:53 etc
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 home
drwxr-xr-x    5 root     root          4096 Aug 20 10:30 lib
drwxr-xr-x    5 root     root          4096 Aug 20 10:30 media
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 mnt
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 opt
dr-xr-xr-x  112 root     root             0 Oct 19 09:54 proc
drwx------    1 root     root          4096 Oct 19 09:54 root
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 run
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 sbin
drwxr-xr-x    2 root     root          4096 Aug 20 10:30 srv
dr-xr-xr-x   13 root     root             0 Oct 19 09:54 sys
drwxrwxrwt    2 root     root          4096 Aug 20 10:30 tmp
drwxr-xr-x    7 root     root          4096 Aug 20 10:30 usr
drwxr-xr-x   11 root     root          4096 Aug 20 10:30 var
/ #

@josegonzalez
Copy link
Member

Seems to be a failure in an existing test. Mind taking a look at that and adding a test to prove this fix?

@safeforge
Copy link
Contributor Author

safeforge commented Oct 22, 2019

@josegonzalez thank you for quick review! Unfortunately I don't have much experience with bats and I've no idea how to test the presence of flag --interactive when run with tty, can you help me to figure out how to go ahead?

@skorokithakis
Copy link

skorokithakis commented Nov 4, 2019

I can confirm this fix works for me. Given how big a breakage this is, I would roll this out in a patch release and figure out testing later, because nobody can use shells as it stands.

@shulcsm
Copy link

shulcsm commented Nov 4, 2019

This affects us so much we would consider reverting that feature if it can't be fixed trivially

@skorokithakis
Copy link

@shulcsm You can work around it by replacing your /var/lib/dokku/plugins/scheduler-docker-local/scheduler-run with the edited one in the PR.

@josegonzalez
Copy link
Member

Going to merge this in for now and figure out how to test it later.

@josegonzalez josegonzalez merged commit a5e6739 into dokku:master Nov 5, 2019
josegonzalez added a commit that referenced this pull request Nov 5, 2019
# History

## 0.19.7

Install/update via the bootstrap script:

```shell
wget https://raw.githubusercontent.com/dokku/dokku/v0.19.7/bootstrap.sh
sudo DOKKU_TAG=v0.19.7 bash bootstrap.sh
```

### Documentation

- #3765: @znz Fix typo in desc of is_tls13_available

### Other

- #3739: @safeforge dokku run do not supports interactive mode.
- #3762: @dependabot-preview[bot] chore(deps): bump handlebars from 4.4.5 to 4.5.1 in /tests/apps/.websocket.disabled
@safeforge safeforge deleted the dokku-run-interactive branch November 5, 2019 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants