docker network pruneで解決!
2019年4月7日日曜日
docker pull できなくなったとき
docker pull できなくなったとき、その他yumとか通信できなくなったとき、ゴミnetworkがあるみたい。
2017年6月15日木曜日
localstack 動かしてみた
localstack
ローカルでAWS検証できるよーと教えていただきました。
SQSを検証したいのでやってみます。
git cloneしますっ
$ git clone https://github.com/atlassian/localstack.git
Cloning into 'localstack'...
remote: Counting objects: 1734, done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 1734 (delta 49), reused 70 (delta 32), pack-reused 1629
Receiving objects: 100% (1734/1734), 643.27 KiB | 209.00 KiB/s, done.
Resolving deltas: 100% (1129/1129), done.
↓を参考に起動します
dockerです
$ docker run -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
docker: Cannot connect to the Docker daemon at tcp://192.168.59.103:2376. Is the docker daemon running?.
See 'docker run --help'.
エラーになりますねー。ググると以下の情報がありました。
環境変数を調べます
$ export -p
declare -x DOCKER_CERT_PATH="/Users/xxxxx/.boot2docker/certs/boot2docker-vm"
declare -x DOCKER_HOST="tcp://192.168.59.103:2376"
declare -x DOCKER_TLS_VERIFY="1"
先のサイトにあったように DOCKER_某 を削除しますー
$ unset DOCKER_CERT_PATH
$ unset DOCKER_HOST
$ unset DOCKER_TLS_VERIFY
再び・・・
$ docker run -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
Unable to find image 'atlassianlabs/localstack:latest' locally
latest: Pulling from atlassianlabs/localstack
a59xxxxxxxxx: Pull complete
Digest: sha256:45xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Status: Downloaded newer image for atlassianlabs/localstack:latest
/usr/lib/python2.7/site-packages/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
'Supervisord is running as root and it is searching '
2017-06-14 15:40:19,301 CRIT Supervisor running as root (no user in config file)
2017-06-14 15:40:19,304 INFO supervisord started with pid 1
2017-06-14 15:40:20,310 INFO spawned: 'dashboard' with pid 8
2017-06-14 15:40:20,312 INFO spawned: 'infra' with pid 9
. .venv/bin/activate; PYTHONPATH=. exec localstack/mock/infra.py
(. .venv/bin/activate; bin/localstack web --port=8080)
2017-06-14 15:40:21,325 INFO success: dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-06-14 15:40:21,325 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Starting local dev environment. CTRL-C to quit.
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 172-913-376
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 (port 4572)...
Starting mock SNS (port 4575)...
Starting mock SQS (port 4576)...
Starting mock API Gateway (port 4567)...
Starting mock DynamoDB (port 4569)...
Starting mock DynamoDB Streams service (port 4570)...
Starting mock Firehose service (port 4573)...
Starting mock Lambda service (port 4574)...
Starting mock Kinesis (port 4568)...
Starting mock Redshift (port 4577)...
Starting mock Route53 (port 4580)...
Starting mock SES (port 4579)...
Starting mock CloudFormation (port 4581)...
Starting mock CloudWatch (port 4582)...
[2017-06-14T15:40:29,272][INFO ][o.e.n.Node ] [] initializing ...
(略)
Ready.
Ready.になりました!うまくいったようです!
http://localhost:8080 にアクセスします。
Ready.
となっているターミナルの続きにリクエストがズラズラ表示されます
Ready.
172.17.0.1 - - [14/Jun/2017 15:48:59] "GET / HTTP/1.1" 200 -
172.17.0.1 - - [14/Jun/2017 15:48:59] "GET /node_modules/@atlassian/aui/dist/aui/css/aui.css HTTP/1.1" 200 -
172.17.0.1 - - [14/Jun/2017 15:48:59] "GET /node_modules/@atlassian/aui/dist/aui/css/aui-experimental.css HTTP/1.1" 200 -
つづく・・・
2017年2月28日火曜日
Docker for Mac
Docker for Mac
こちらからインストール
ターミナルで確認
~ $ docker --version
Docker version 1.13.1, build 092cba3
~ $ docker-compose --version
docker-compose version 1.11.1, build 7c5d5e4
~ $ docker --version
Docker version 1.13.1, build 092cba3
~ $ docker-machine --version
docker-machine version 0.9.0, build 15fd4c7
Docker version 1.13.1, build 092cba3
~ $ docker-compose --version
docker-compose version 1.11.1, build 7c5d5e4
~ $ docker --version
Docker version 1.13.1, build 092cba3
~ $ docker-machine --version
docker-machine version 0.9.0, build 15fd4c7
hello-world
~ $ docker run hello-world
docker: Cannot connect to the Docker daemon at tcp://192.168.59.103:2376. Is the docker daemon running?.
See 'docker run --help'.
docker: Cannot connect to the Docker daemon at tcp://192.168.59.103:2376. Is the docker daemon running?.
See 'docker run --help'.
エラー!?
sudo つけてみた、、、
~ $ sudo docker run hello-world
Password:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest:
Status: Downloaded newer image for 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.
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://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
Password:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest:
Status: Downloaded newer image for 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.
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://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
web server
~ $ docker run -d -p 80:80 --name webserver nginx
docker: Cannot connect to the Docker daemon at tcp://192.168.59.103:2376. Is the docker daemon running?. See 'docker run --help'.
docker: Cannot connect to the Docker daemon at tcp://192.168.59.103:2376. Is the docker daemon running?. See 'docker run --help'.
エラー!?
sudoつけてみた、、、
~ $ sudo docker run -d -p 80:80 --name webserver nginx
Password:
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
5040bd298390: Pull complete
31123d939af1: Pull complete
23f1bdd267a9: Pull complete
Digest:
Status: Downloaded newer image for nginx:latest
Password:
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
5040bd298390: Pull complete
31123d939af1: Pull complete
23f1bdd267a9: Pull complete
Digest:
Status: Downloaded newer image for nginx:latest
ブラウザで localhost みると、、、
オーケー!
プロセスみてみる、、、sudoつけてね
~ $ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e4134e2e67d nginx "nginx -g 'daemon ..." 17 minutes ago Up 16 minutes 0.0.0.0:80->80/tcp, 443/tcp webserver
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e4134e2e67d nginx "nginx -g 'daemon ..." 17 minutes ago Up 16 minutes 0.0.0.0:80->80/tcp, 443/tcp webserver
nginxが動いているね。
webserver を止めてみる、、、
~ $ sudo docker stop webserver
webserver
~ $ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ed0928c3844 hello-world "/hello" 7 minutes ago Exited (0) 7 minutes ago kind_bhabha
9e4134e2e67d nginx "nginx -g 'daemon ..." 19 minutes ago Exited (0) 9 seconds ago webserver
webserver
~ $ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ed0928c3844 hello-world "/hello" 7 minutes ago Exited (0) 7 minutes ago kind_bhabha
9e4134e2e67d nginx "nginx -g 'daemon ..." 19 minutes ago Exited (0) 9 seconds ago webserver
nginxがExitedしているね。
webserverのコンテナを削除してみる、、、
~ $ sudo docker rm -f webserver
webserver
~ $ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ed0928c3844 hello-world "/hello" 8 minutes ago Exited (0) 8 minutes ago kind_bhabha
webserver
~ $ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6ed0928c3844 hello-world "/hello" 8 minutes ago Exited (0) 8 minutes ago kind_bhabha
削除されているね。
以上、
Get started with Docker for Mac
でした。
登録:
投稿 (Atom)


