Current Size:
Chakra BreakPoints
base0px
sm480px
md768px
lg992px
xl1280px
2xl1536px
Current Height:Width
widthpx
heightpx

Subjects

Docker Images Notes 2020

Date Created: 2023/02/20

Last Update: 2024/03/30

#cheatsheet #docker-image #notes

REFERENCE

Custom dockerfile reference for TypeScript Node Express API Service Starter

IMAGE

Build

Build Docker Image from dockerfile

docker build --tag <image-name> .

docker build -t <image-name> .

Build Docker Image from Dockerfile with alt file name

docker build --file ./path/to/dockerfile --tag <image-name> .

Example

docker build --file Dockerfile.development --tag ts-express/zoho-api-service

CONTAINER

Create Container

docker create --name <container-name> --port <external-prot>:<internal-port> <image-name>

docker create --name <container-name> <image-name>

Example

docker create --name ts-express-zoho-api-service-1 ts-express/zoho-api-service

Start Container

docker start -i <container-name>

Example

docker start -i ts-express-zoho-api-service-1

Run Container

Docker Run is a combination of create and start

docker run --name <container-name> -it -p 3333:3333 <image-name>

Example

docker run --name -it ts-express-zoho-api-service-1 -p 3333:3333 ts-express/zoho-api-service

Hot Reload Watch

docker run --name <container-name> -v $PWD:/app -v app/node_modules -p 3333:3333 <image-name>

Execute Command in Container

docker exec -it <container-name> bash

or

docker exec -it <container-name> sh

example

docker exec -it l-dev bash

docker exec -it <container-name> sh

More Notes

All Notes
HomeProjects

Links

Home Articles Notes Projects About Style Guide Site Credits

Contact

 [email protected]

Location

🌎 Earth