Run a New Container

<< Click to Display Table of Contents >>

Raynet One Technology Catalog > 14.0 u1 > Installation Guide > Appendix A. Basic Docker Commands 

Run a New Container

Start a new container from an image

docker run IMAGE[:TAG]

Example:

docker run raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and assign it a name

docker run --name CONTAINER IMAGE[:TAG]

Example:

docker run --name catalog raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and map a port

docker run -p HOSTPORT:CONTAINERPORT IMAGE[:TAG]

Example:

docker run -p 8080:80 raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and map all ports

docker run -P IMAGE[:TAG]

Example:

docker run -p raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image in the background

docker run -d IMAGE[:TAG]

Example:

docker run -d raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and assign a hostname

docker run --hostname HOSTNAME IMAGE[:TAG]

Example:

docker run --hostname myhost raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and add a dns entry

docker run --add-host HOSTNAME:IP IMAGE[:TAG]

Example:

docker run --add-host myhost:192:168:255:1 raynetgmbh/rayventory-catalog:stable

 

Start a new container from an image and map a local directory to the container

docker run -v HOSTDIR:TARGETDIR IMAGE[:TAG]

Example:

docker run -v ~/:/Usr/Raynet/Catalog rayventory-catalog:stable

 

Start a new container from an image and change the entry point

docker run -it --entrypoint EXECUTABLE IMAGE[:TAG]

Example:

docker run -it --entrypoint bash raynetgmbh/rayventory-catalog:stable