least 1 argument. See 'docker run --help'. Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Create and run a new container from an image このコマンドの後に続くイメージとオプションで コンテナを起動します。手元にないイメージは レジストリから取得されます。 docker run は docker container run のエイリアス 正しい方は長いので docker run とよく書きます $ docker container run "docker container run" requires at least 1 argument. See 'docker container run --help'. Usage: docker container run [OPTIONS] IMAGE [COMMAND] [ARG...] Create and run a new container from an image docker container run
run --rm hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (arm64v8) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
compose -f ./05-dockerfile/compose.yaml up –d [+] Running 3/3 Network 05-dockerfile_default Created 0.0s Container mysql Started 0.1s Container backend Started 0.2s 2つのコンテナが起動した!
[+] Running 4/4 Network 07-metrics_default Created 0.0s Container monitoring-node-exporter Started 0.3s Container prometheus Started 0.4s Container grafana Started 0.5s # 起動状態を確認する(下の表示はやや省略しています) $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cd66bfd85a4b grafana/grafana:latest "/run.sh" About a minute ago Up About a minute 0.0.0.0:3000->3000/tcp, :::3000- >3000/tcp grafana 7bb3d0c0ddda prom/prometheus "/bin/prometheus --c…" About a minute ago Up About a minute 0.0.0.0:9090- >9090/tcp, :::9090->9090/tcp prometheus b2ae10f05244 prom/node-exporter:latest "/bin/node_exporter …" About a minute ago Up About a minute 9100/tcp monitoring-node-exporter ステップ 07・サービスを監視してみよう