Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Tech-Chat github karshunibremen

# enable swarm feature in docker
docker swarm init
Comment

Tech-Chat github karshunibremen

# docker manager join token
docker swarm join-manager manager
Comment

Tech-Chat github karshunibremen

# docker service create
docker service create <image-name> <option>

# example
docker service create alpine ping 8.8.8.8
Comment

Tech-Chat github karshunibremen

# force container to remove
docker container rm -f <container id>
Comment

Tech-Chat github karshunibremen

# inspect about a docker image
docker image inspect <image-name>
Comment

Tech-Chat github karshunibremen

# get history of a image
docker history <image-name>
Comment

Tech-Chat github karshunibremen

# docker pull an image
docker pull <image-name>:<version>
Comment

Tech-Chat github karshunibremen

# docker list images
docker image ls
Comment

Tech-Chat github karshunibremen

# docker connect to already existing network
docker network connect <network-id> <container-id>
Comment

Tech-Chat github karshunibremen

# docker create network
docker network create <name-of-network>
Comment

Tech-Chat github karshunibremen

# docker network list
docker network ls
Comment

Tech-Chat github karshunibremen

# checking port map in a docker container
docker container port <container-name>
Comment

Tech-Chat github karshunibremen

# run bash in already running container in parallel
docker container exec -it <container-name> bash
Comment

Tech-Chat github karshunibremen

# run bash shell in a docker container
docker container run -it --name <your_choice> <image_name> bash
Comment

Tech-Chat github karshunibremen

# get docker stats on a container
docker container stats <container-name>
Comment

Tech-Chat github karshunibremen

# get docker statistics on resources
docker container stats 
Comment

Tech-Chat github karshunibremen

# list containers in docker
docker container ps -a
Comment

Tech-Chat github karshunibremen

# remove container from docker
docker container rm <first 3 characters of container id>
Comment

Tech-Chat github karshunibremen

# syntax for docker container run
docker container run --publish <host-port>:<container-port> --detach --name <unique name of your choice> nginx
Comment

Tech-Chat github karshunibremen

# docker run example with detach 
docker container run -p 80:80 --detach nginx
Comment

Tech-Chat github karshunibremen

# docker run example with nginx
docker container run -p 80:80 nginx
Comment

Tech-Chat github karshunibremen

# docker logout
docker logout
Comment

Tech-Chat github karshunibremen

# docker user login
docker login
Comment

Tech-Chat github karshunibremen

# get docker version
docker version
Comment

Tech-Chat github karshunibremen

# adding user mod to docker or adding user to docker 
sudo usermod -aG docker <username>
Comment

Tech-Chat github karshunibremen

# docker node update role 
docker node update --role <manager/worker> <node-name>

#Example
docker node update --role manager node2
Comment

Tech-Chat github karshunibremen

# docker service update service with replicas/ scaling
docker service update <service-id/service-name> --replicas <count>

#Example
docker service update mqtt_client --replicas 3
Comment

Tech-Chat github karshunibremen

# docker service list node
docker service ls
Comment

Tech-Chat github karshunibremen

#docker service create with replicas
docker service create --replicas <count> <image-name> <option>

# example
docker service create --replicas 3 alpine ping 8.8.8.8 
Comment

Tech-Chat github karshunibremen

#docker info
docker info
Comment

Tech-Chat github karshunibremen

# docker build images
docker build -f <path-to-Dockerfile> .
Comment

PREVIOUS NEXT
Code Example
Shell :: shell get given line 
Shell :: how to put access.log in gitignore 
Shell :: cordova plugin install specific branch 
Shell :: shell_to_meterpreter 
Shell :: typo3 clearc chace over commandline 
Shell :: ubonto change lang switch commad 
Shell :: libthai0:i386 depends on libdatrie1 (= 0.2.0); however: Package libdatrie1:i386 is not configured yet. 
Shell :: rsync follow symlink 
Shell :: cordova install plugin at branch 
Shell :: rhel 8 docker 19.03 
Shell :: how to get environment in string linux shell 
Shell :: kubectl delete pods wildcard 
Shell :: atmel studio download ubuntu 
Shell :: /usr/bin/env: «node»: The file or directory does not exist nvm 
Shell :: How to edit unit file content with systemctl command 
Shell :: instalar cabal do haskell no ubuntu 
Shell :: makefile shell if 
Shell :: how to install amethyst on mac 
Shell :: ssh key meaning 
Shell :: git create branches 
Shell :: create a new repository 
Shell :: delete a remote branch in git 
Shell :: firefox http download allow 
Shell :: show git branch in terminal fish 
Shell :: Target Packages (main) 
Shell :: mac ferdi install 
Shell :: install ddev on linux 
Shell :: sort filesddddd 
Shell :: ex: push a new local repository to github. 
Shell :: UNIX debian ubuntu download python3912 without certificate error 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =