我已经使用了docker login命令并通过了我的凭证,我收到了警告WARNING: login credentials saved in /Users/{my_username}/.docker/config.json.我已检查过该文件,确实我的密码是未加密的(仅限base64编码).
为什么docker保存我的密码未加密?不应该把它保存在我的钥匙链中(我在Mac OS上)或者不是保存密码只是生成一些访问令牌或类似的东西?
我有一个数据库的备份,我将恢复到在docker容器内运行的postgres数据库.
我在OS X上使用的是docker-
machine.Postgres图像是postgres:9.4.
这是我到目前为止提出的脚本:
pg_restore --verbose --clean --no-acl --no-owner \
-h tcp://`docker-machine ip default`:5432 \
-U postgres \
-d tonsser-api_development latest.dump
Run Code Online (Sandbox Code Playgroud)
但这不起作用.我收到错误:
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "tonsser-api_development" failed: could not translate host name "tcp://192.168.99.100:5432" to address: nodename nor servname provided, or not known
Run Code Online (Sandbox Code Playgroud) 我正在尝试构建docker镜像,但是在下载图像层期间,docker会永久挂起:
我尝试了几次,它只是停止在不同的点下载.我也试过docker-machine restart没有任何影响.
我在Mac OS X上使用docker机器:
$ docker -v
Docker version 1.9.1, build a34a1d5
$ docker-machine -v
docker-machine version 0.5.5, build 02c4254
Run Code Online (Sandbox Code Playgroud)
知道怎么解决吗?
我在运行postgres容器时遇到问题,我在Mac OS机器上为数据文件夹设置了卷.我试着像这样运行它:
docker run \
--name my-postgres \
-e POSTGRES_USER=admin \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=some_db_dev \
-v $PG_LOCAL_DATA:/var/lib/postgresql/data \
-d postgres:9.5.1
Run Code Online (Sandbox Code Playgroud)
每次我在日志中得到以下结果:
* Starting PostgreSQL
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are …Run Code Online (Sandbox Code Playgroud) 我是码头工人的新手.刚尝试在端口80上运行容器
docker run -p 80:80 kitematic/hello-world-nginx
Run Code Online (Sandbox Code Playgroud)
它似乎工作正常.我可以访问该网站http://192.168.99.100/
但我尝试将端口更改为
docker run -p 70:50 kitematic/hello-world-nginx
Run Code Online (Sandbox Code Playgroud)
我无法访问网站 http://192.168.99.100:70.那么我该如何设置不同的端口并连接到网站呢?
我已经安装了Docker yum install docker:
$ uname -a
Linux caspgval4 3.10.0-229.20.1.el7.x86_64 #1 SMP Wed Nov 4 10:08:36 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
$ docker --version
Docker version 1.12.6, build 3a094bd/1.12.6
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ sudo systemctl status docker
? docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: http://docs.docker.com
Run Code Online (Sandbox Code Playgroud)
我正在尝试安装和运行Docker,但出现如下错误:
$ sudo service docker start
Redirecting to …Run Code Online (Sandbox Code Playgroud) 我使用https://docs.docker.com/docker-for-windows/install/#install-docker-for-windows在Windows 10上安装了适用于Windows的Docker Desktop.它不使用VirtualBox和默认VM来托管docker.
我能够运行容器,但我如何使用ssh连接到docker?
docker-machine ls 没有显示我的docker主机.
试图连接到docker@10.0.75.1但它需要密码.而tcuser用于boot2docker VM的不匹配:
ssh docker@10.0.75.1无法创建目录'/home/stan/.ssh'.主机'10 .0.75.1(10.0.75.1)'的真实性无法确定.RSA密钥指纹是....你确定要继续连接(是/否)?是无法将主机添加到已知主机列表(/home/stan/.ssh/known_hosts).docker@10.0.75.1密码:写入失败:由对等方重置连接
我在Windows 10上使用Docker Toolbox
我可以通过http://192.168.99.100:8000成功访问php部分,我一直在研究mariadb部分,但仍然有一些问题
我有一个sql文件,/mariadb/initdb/abc.sql因此应该将其复制到中/docker-entrypoint-initdb.d,在创建容器之后,我使用它docker-compose exec mariadb来访问该容器,虽然存在该文件,/docker-entrypoint-initdb.d/abc.sql但该文件从未执行过,但我还测试了如何手动将sql文件导入到该容器中,成功了,因此sql文件有效
我不太了解数据文件夹映射,以及如何使文件夹与容器同步,我总是在使用重新创建容器时收到警告 docker-compose up -d
WARNING: Service "mariadb" is using volume "/var/lib/mysql" from the previous container. Host mapping "/.../mariadb/data" has no effect. Remove the existing containers (with docker-compose rm mariadb) to use the Recreating db ... done
问题
/docker-entrypoint-initdb.d要执行的sql文件?请指导谢谢
这是我的 docker-compose.yml
version: "3.2"
services:
php:
image: php:7.1-apache
container_name: web
restart: always
volumes:
- /.../php:/var/www/html
ports:
- "8000:80"
mariadb:
image: mariadb:latest …Run Code Online (Sandbox Code Playgroud) 以下命令出错.但是,如果我在浏览器中打开https://api.github.com/repos/boot2docker/boot2docker/releases/latest,我可以获得json结果 吗?
PS C:\> .\bin\docker-machine-Windows-x86_64.exe create --driver hyperv --hyperv-virtual-switch "Virtual Switch Main" default
Run Code Online (Sandbox Code Playgroud)
运行预创建检查......
(默认)在本地找不到默认的Boot2Docker ISO,下载最新版本...
预创建检查出错:"获取https://api.github.com/repos/boot2docker/boot2docker/releases/latest:read tcp 10.8.159.1:50158->192.30.253.117:443:wsarecv:现有连接是被远程主机强行关闭."
我尝试了以下内容并得到了同样的错误.
.\bin\docker-machine-Windows-x86_64.exe create --driver hyperv --hyperv-virtual-switch "Virtual Switch Main" --engine-env "HTTP_PROXY=http://myProxy.com" --engine-env "HTTPS_PROXY=http://myProxy.com" default
Run Code Online (Sandbox Code Playgroud) 我正在使用Windows 10 Home,连接到docker时出现此错误:
ERRO[0044] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial tcp 192.168.99.101:2376: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
context canceled
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?我见过适用于Linux和OS的解决方案,但不适用于Windows
docker ×10
docker-machine ×10
boot2docker ×2
postgresql ×2
dockerfile ×1
macos ×1
pg-restore ×1