Skip to content

dideex/docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker commands

Run

command run with params

docker run busybox echo hi there
docker run busybox ls

container run with port mapping

docker run -p 80:3000 [container id]

separated run

docker create hello-world
docker start -a [container id]

get stdout from the container

docker logs [container id]

run command inside the container

docker exec -it [container id] [command]
docker exec -it 4e3d15293585 sh
docker run -it alpine sh

run container on background

docker run -d [container id]

Build

build an image

docker build .

build an image with tag

docker build -t dideex/name:tag .

build with custom Dockerfile

docker build -f Dockerfile.dev

Compose

run composed images

docker-compose up
docker-compose up --build

stop the running composed containers

docker-compose down

compose status(depends on current directory)

docker-compose ps

start silent

docker-compose [container id] -d

Common

show running containers

docker ps
docker ps --all

commit a command into container

docker commit -c 'CMD ["redis-server"]' [container id]

clean cache and other staff

docker system prune

shutdown the container

docker stop [container id]
docker kill [container id]

Attach local standard input, output, and error streams to a running container

docker attach [container id]

Volumes

add spareted volume to the container

docker run -p 80:3000 -v /app/node_modules -v $(pwd):/app [container id]
# for docker toolbox
docker run -p 80:3000 -v /app/node_modules -v /c/frontend/:/app [container id]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors