I need to get a file from the docker image running on AWS Elastic Beanstalk.

I can SSH into the EB instance, but after that I have no idea what to do.

sudo docker images shows two images, one with my app name and the other called aws-beanstalk/current-app.


One way of copying a file would be to do it from the container. If you have a running container, use docker cp to transfer the file to your host, in this case the EB instnace.

Run docker ps to get the container ID. If you don't see any output, launch a container based on the image you are interested in. Say, if your image name is 'aws-beanstalk/current-app' -

docker run -ti --rm aws-beanstalk/current-app /bin/bash

Then from the docker host, for instance to transfer a file under /code/run.py on the container to /tmp on the host:

docker cp containerID:/code/run.py /tmp

The containerID is the one you see after running docker ps

You can also use docker exec -ti containerID /bin/bash to interactively work on an already running container.

  • The docker cp command didn't understand wildcards, but copying a file at a time worked. Thanks. – Synesso May 6 '15 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.