OSDN Git Service

Regular updates
[twpd/master.git] / docker.md
index bc074c7..eafad3f 100644 (file)
--- a/docker.md
+++ b/docker.md
@@ -12,6 +12,7 @@ Manage images
 ```yml
 docker build [options] .
   -t "app/container_name"    # name
+  --build-arg APP_HOME=$APP_HOME    # Set build-time variables
 ```
 
 Create an `image` from a Dockerfile.
@@ -24,6 +25,11 @@ docker run [options] IMAGE
   # see `docker create` for options
 ```
 
+#### Example
+
+```
+$ docker run -it debian:buster /bin/bash
+```
 Run a command in an `image`.
 
 Manage containers
@@ -37,7 +43,7 @@ docker create [options] IMAGE
   -i, --interactive          # attach stdin (interactive)
   -t, --tty                  # pseudo-tty
       --name NAME            # name your image
-  -p, --publish 5000:5000    # port map
+  -p, --publish 5000:5000    # port map (host:container)
       --expose 5432          # expose a port to linked containers
   -P, --publish-all          # publish all ports
       --link container:alias # linking
@@ -97,6 +103,18 @@ $ docker kill $ID
 
 Manage `container`s using ps/kill.
 
+
+### `docker logs`
+
+```
+$ docker logs $ID
+$ docker logs $ID 2>&1 | less
+$ docker logs -f $ID # Follow log output
+```
+
+See what's being logged in an `container`.
+
+
 Images
 ------