Tech-Chat github karshunibremen code example

Example 1: Tech-Chat github karshunibremen

# docker manager join token
docker swarm join-manager manager

Example 2: Tech-Chat github karshunibremen

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

# example
docker service create alpine ping 8.8.8.8

Example 3: Tech-Chat github karshunibremen

# enable swarm feature in docker
docker swarm init

Example 4: 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

Example 5: Tech-Chat github karshunibremen

# docker logout
docker logout

Example 6: Tech-Chat github karshunibremen

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

Example 7: Tech-Chat github karshunibremen

# docker user login
docker login

Example 8: Tech-Chat github karshunibremen

# get docker version
docker version

Example 9: Tech-Chat github karshunibremen

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

Example 10: 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

Tags:

Misc Example