Comments (3)
Is <pid>
in your case the ID of the postgres container, or is it of another container?
Depending on the container you're trying to exec
into, that command may fail if bash
is not present inside your container; it's common for containers to only contain the minimum amount of tools (to have a smaller attack surface); if a shell is present inside the container, you may try using sh
instead (which should be available for images based on a linux distro)
from docs.
from docs.
The docker exec
part on that page describes running docker exec
into the postgres
container (which uses the postgres:latest
image if I'm not mistaken);
I did not go through the full example, but trying a more minimal example with the postgres
image, and running docker exec
in that container works, so I wondered if you were trying to docker exec
into another container (which may not have bash
installed);
docker run -d --name mypostgres -e POSTGRES_DB=example -e POSTGRES_PASSWORD=password postgres
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c0d124d2465d postgres "docker-entrypoint.sā¦" 3 seconds ago Up 2 seconds 5432/tcp mypostgres
docker exec -it c0d124d2465d bash
root@c0d124d2465d:/# exit
exit
from docs.
Related Issues (20)
- Apply executable permissions to the binary HOT 2
- [404]: <upstart> HOT 2
- Rootless mode does not mention new file area HOT 3
- Install button not working. HOT 2
- .dockerignore file link is broken HOT 1
- Uninstall documentation reference non-existent uninstall script HOT 5
- Didn't work on Sonoma HOT 4
- incorrect
- Incorrect information of what the project name is based on HOT 3
- Relation to `build` and `image` incorrect?
- HTML (Web Components) library Not Found
- [404]: /guides/walkthroughs/ HOT 1
- Incorrect mention that hostname is the container name
- The documentation is wrong or the developers are wrong.
- Communicate between a container and a swarm service section's information is incorrect HOT 1
- `docker-compose up -e` not available on MacOS HOT 4
- Environment mixing
- Where does the healthcheck command come from HOT 1
- Guides using non-standard beta features (init) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.