node.js, domino-db & Docker (11): Usefull Docker Commands

Building Images

docker build -t domino-express .

Creates a new docker container named domino-express, using the current folder („.“).

Starting / Stopping

docker run --name dominoexpress -p 3000:3000 -d -it domino-express

Starts the image domino-express, allows access to port 3000 and gives the container the static name „dominoexpress„. If option –name is not available, a random name is generated.

Additional parameter -e allows setting of environment variables.

docker stop dominoexpress

Stops the container with the name „dominoexpress

List instances

docker ps

Lists the current running containers.

docker ps -a

Lists all containers, even if they have stoped working / not running.

Delete container

docker rm dominoexpress

Deletes the container with the name „dominoexpress„.

Logs

docker logs dominoexpress

Get the logs of the container „dominoexpress„. Usefull to check why a container crashed.

Getting „inside“

docker exec -it dominoexpress bash

Starts a process (in this case a bash) in the running container „dominoexpress„.

Dieser Beitrag wurde unter Docker abgelegt und mit verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.