score:0
You have to remove the " to work.
docker exec -ti $(docker container ps -f name=mycontainername -q) sh
But why would you this anyway?
You can run:
docker exec -ti mycontainername sh
score:0
On my windows machine, it only works when I supply the /bin/bash to the command.
Here is the working command:
docker exec -it mongodb /bin/bash
Source: stackoverflow.com
Related Query
- How to fix "docker exec" requires at least 2 arguments
- How to correct docker in makefile which requires at least 1 argument for remove all containers command
- Docker exec Requires minimum of 2 arguments
- How to fix 'Job failed: invalid volume specification' for gitlab-runner exec docker on osx
- docker commit requires at least 1 and at most 2 arguments
- How to pass arguments to Shell Script through docker run
- How to run 2 commands with docker exec
- How to fix ctrl+c inside a docker container
- How can I set the current working directory for docker exec with an internal bash shell?
- Docker machine timeout - how to fix without destroying the machine?
- how to run docker exec on a docker-compose.yml
- Why removing docker containers and images does not free up storage space on Windows? How to fix it?
- how to pass command line arguments to a python script running in docker
- How can I pass arguments to a docker container with a python entry-point script using command?
- I am using Azure Devops to build and push my Docker image. How can I pass arguments while doing buildAndPush using Docker task?
- How do you fix a docker push error, tag does not exist?
- How to fix this issue "no suitable node (scheduling constraints not satisfied on 1 node)" in docker swarm while deploying registry?
- How to fix the WARNINGs when running the redis:alpine Docker image
- How to fix "sh: 0: Can't open start.sh" in docker file?
- How to send files as arguments of docker commands?
- How to pass docker container arguments when running the image in a Jenkinsfile
- How to address 'OSError: libc not found' raised on Gunicorn exec of Flask app inside Alpine docker container
- passing arguments to docker exec from bash prompt and script
- How to get docker exec stdout to be as verbose as running command in container?
- How to fix error "npm ERR! could not detect node name from path or package" when building simple app with docker and nodeJS?
- How to fix Docker error "hnsCall failed in Win32: An adapter was not found" when deploying service?
- How to pass command parameters with arguments (for e.g --param1=arg1) to Docker container run command in Synology DSM
- How to fix empty Docker LogPath
- How to fix 'sh: tsc not found' error in docker container when using Gitlab CI docker-in-docker
- How to pass command line arguments to a docker image
More Query from same tag
- Cannot connect to SQL Server from a Docker container
- Docker: Benefit of the "From"-Instructions?
- trying to use $(command) inside docker sdk entrypoint
- Pass ARG from docker-compose.yml to a docker image
- How to mount PostgreSQL data directory in Kubernetes?
- Unable to find Jupyter notebook via Docker
- Cannot conect to Docker container running in VSTS
- Docker ubuntu 18.04 ssh-keyscan
- Not able to containerise .net 5.0 web API
- Docker web terminal
- Is a docker image available for DocDokuPLM?
- Link containers in docker (RancherOS and command line)
- Permission denied inside Docker container
- Consume python package from Azure feed in a local (not Azure) docker instance
- Running docker container for a test
- xdebug not working in Docker Desktop for Mac
- Which is the best OS for ForgeRock products (i.e. AM, IDM, DS and IG) to be used in Docker container?
- should I create a VM and then use docker machine inside the VM for development
- Mongo docker image - unable to run on different port
- ASP.NET Core Angular Template in Docker watching file changes
- How do I edit a file after I shell to a Docker container?
- How to reverse SSH tunnel to remote docker container for Xdebug?
- Where to put ebextensions config in AWS Elastic Beanstalk Docker deploy with dockerrun source bundle?
- Docker desktop / daemon won't start on new M1
- How can I remove the Cmd entry from a Docker image configuration?
- django postgresql password authentication failed for user
- Problem with Docker(sudo: status: command not found)
- How to `docker-compose up --build` without downtime?
- Setting up CD for a Ruby on Rails project with Bitbucket Pipelines and Docker
- Cannot delete files on docker host