Skip to content

Instantly share code, notes, and snippets.

@dineshsprabu
Last active October 24, 2017 14:09
Show Gist options
  • Save dineshsprabu/771589916545b8e91cee50b9017a4123 to your computer and use it in GitHub Desktop.
Save dineshsprabu/771589916545b8e91cee50b9017a4123 to your computer and use it in GitHub Desktop.
[Docker] Useful docker commands

Docker commands

Creating building docker image. Create Dockerfile with below content. Run docker build -t <image-name> .

FROM steveny/predictionio
CMD ["python", "app.py"]
EXPOSE 8000

Running a docker with image. -i opens interactive shell.

docker run -it <image-name> /bin/bash

List running container process.

docker ps

Running command on running container.

docker exec -it <container-id> /bin/bash

Attach to existing interactive session.

docker attach <container-id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment