Reputation: 81
I have a running container in Docker. When I try to access it via PowerShell using:
docker run curl -d '{ "action" : "version" }' localhost:17076
it says
Unable to find image 'curl:latest' locally
docker: Error response from daemon: pull access denied for curl, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
Though I am able to use the above function starting with curl -d '{...
when being inside the Docker-Terminal.
The command docker ps
within PowerShell returns container ID
Image
Command
Created
Status
Ports
and Names
with the adequate information.
Is there anyone with an idea how to access the running container from PowerShell?
Upvotes: 1
Views: 509
Reputation: 742
I think you're looking for the command docker exec
rather than docker run
. As in, something like the following:
docker exec -it <container_name> sh -c "curl -d '{ \`"action\`" : \`"version\`" }' localhost:17076"
Upvotes: 3