我有以下docker组成:
open( my $pipe_fh, "foo |" );
while ( my $row = <$pipe_fh> ) {
# do stuff
print $row;
}
我从$row
开始,然后从bar
version: '3'
services:
postgres:
container_name: test-psql
image: postgres:10.4-alpine
restart: always
ports:
- 5432:5432
volumes:
- ~/docker_data/postgres:/data/postgres
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
但是当尝试使用docker-compose up
docker ps
我收到错误
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4cae94afaa6 postgres:10.4-alpine "docker-entrypoint.s…" 48 seconds ago Up 47 seconds 0.0.0.0:5432->5432/tcp test-psql
答案 0 :(得分:0)
您尝试的内容是正确的-为了防止万一它正常工作,我在一端进行了测试。我建议检查您的防火墙配置。