Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 895 Bytes

docker-container-create.md

File metadata and controls

24 lines (16 loc) · 895 Bytes

Create docker container using image

Creates a new docker container using a loaded image

docker create -p {{PORT}}:{{PORT}} --env-file {{ENV_FILE}} --name {{CONTAINER_NAME}} {{IMAME_ID}}

  • PORT: Port on which container needs to be run
  • ENV_FILE: ENV file to set environment variables inside docker container
  • CONTAINER_NAME: Name which will be assigned to the newly created container

Example:

docker create -p 8080:8080 --env-file ak-cli-prod.env --name ak-cli ak-cli-image

Note: --env-file and --name flags are optional

Related Commands