Difference between revisions of "Docker"

From Teknologisk videncenter
Jump to: navigation, search
m
m
Line 9: Line 9:
 
|docker container ls||Status of running containers (As above)
 
|docker container ls||Status of running containers (As above)
 
|-
 
|-
|docker run ubuntu|| Run container ubuntu (Terminates as its bash exits) - pull container if not present
+
|docker run ubuntu|| Run image ubuntu in containe (Terminates as its bash exits) - pull container if not present
 
|-
 
|-
|docker run -it ubuntu|| Run container ubuntu -it = interactive tty
+
|docker run -d nginx || Run image nginx detach (as daemon stdin/stdout detached)
 +
|-
 +
|docker run -it ubuntu|| Run image ubuntu in container ( -it = interactive tty )
 
|-
 
|-
 
|docker pull nginx || pull container from repository (default docker hub)
 
|docker pull nginx || pull container from repository (default docker hub)

Revision as of 16:07, 22 September 2024


command Explanation
docker ps Status of running containers
docker container ls Status of running containers (As above)
docker run ubuntu Run image ubuntu in containe (Terminates as its bash exits) - pull container if not present
docker run -d nginx Run image nginx detach (as daemon stdin/stdout detached)
docker run -it ubuntu Run image ubuntu in container ( -it = interactive tty )
docker pull nginx pull container from repository (default docker hub)