nicbet / docker-phoenix

A dockerized Phoenix development and runtime environment.
GNU General Public License v3.0
277 stars 57 forks source link

build Problem: ./mix ecto.create #14

Closed gofighting123 closed 5 years ago

gofighting123 commented 5 years ago

the error are as below:

01:26:10.026 [error] GenServer #PID<0.214.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection) lib/db_connection/connection.ex:84: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Hello.Repo couldn't be created: killed

so, when i meet the problem, i just start another image with the follow command to map the localhost:5432 to my pc, and i use db tool and i success get the conntection. but there are no any table there.( i mean it's just empty table but only one postgres database and schema public )

$ docker run -p 5432:5432 6eb6c50a02e7
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint stoic_villani (6449c11d0dd9849f528db3089e67f1bd2c046026fcfdacc3eed4566086b15bc7): Bind for 0.0.0.0:5432 failed: port is already allocated.

user@DESKTOP-LPOFDEQ MINGW64 /c/Program Files/Docker Toolbox
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                    NAMES
a89fa7193099        6eb6c50a02e7        "docker-entrypoint.s…"   About a minute ago   Up About a minute   0.0.0.0:5432->5432/tcp   vigorous_lalande
b836829fdd30        postgres:10         "docker-entrypoint.s…"   18 hours ago         Up 2 minutes        5432/tcp                 hello-phoenix_db_1

so, is there something wrong with the README step, i can't start the web at localhost:4000 :(

nicbet commented 5 years ago

Hi @gofighting123 , first of all, thanks for writing such a detailed issue description.

It appears from your logs that you are trying to run a second database (a89fa7193099 - vigorous_lalande) in addition to the paired database that is sun up through the docker-compose process described in the Readme (b836829fdd30 - hello-phoenix_db_1).

You can either use the included mix and run scripts as a simplification -- or since it appears you are running on Windows, issue the corresponding docker-compose commands directly.

To create a database, you first need to change src/config/dev.exs to point at the database that comes with the compose: db. The steps are described in the README.

Next, you need to run mix ecto.create and mix ecto.migrate steps against that database, either using the included .mix script or by issuing docker-compose run --rm app mix ecto.create and docker-compose run --rm app mix ecto.migrate directly. Both are equivalent.

Could you try these steps and report back any error you receive?

gofighting123 commented 5 years ago

thanks for your reply. i'll try as you said. sure for that. i will keep watching this. i am still learning docker. thanks anyway. 👍

gofighting123 commented 5 years ago

i follow up the README the preparation part and do the command ./mix ecto.create the verbose output as bellow

user@DESKTOP-LPOFDEQ MINGW64 ~/Projects/hello-phoenix ((1.4.0))
$ ./mix ecto.create
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.utils.config.find_config_file: Trying paths: ['C:\\Users\\user\\.docker\\config.json', 'C:\\Users\\user\\.dockercfg']
docker.utils.config.find_config_file: No config file found
docker.utils.config.find_config_file: Trying paths: ['C:\\Users\\user\\.docker\\config.json', 'C:\\Users\\user\\.dockercfg']
docker.utils.config.find_config_file: No config file found
urllib3.connectionpool._new_conn: Starting new HTTPS connection (1): 192.168.99.100:2376
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/version HTTP/1.1" 200 566
compose.cli.command.get_client: docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018
compose.cli.command.get_client: Docker base_url: https://192.168.99.100:2376
compose.cli.command.get_client: Docker version: Platform={'Name': 'Docker Engine - Community'}, Components=[{'Name': 'Engine', 'Version': '18.09.0', 'Details': {'ApiVersion': '1.39', 'Arch': 'amd64', 'BuildTime': '2018-11-07T00:52:55.000000000+00:00', 'Experimental': 'false', 'GitCommit': '4d60db4', 'GoVersion': 'go1.10.4', 'KernelVersion': '4.14.79-boot2docker', 'MinAPIVersion': '1.12', 'Os': 'linux'}}], Version=18.09.0, ApiVersion=1.39, MinAPIVersion=1.12, GitCommit=4d60db4, GoVersion=go1.10.4, Os=linux, Arch=amd64, KernelVersion=4.14.79-boot2docker, BuildTime=2018-11-07T00:52:55.000000000+00:00
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('hellophoenix_default')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/networks/hellophoenix_default HTTP/1.1" 404 39
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('hello-phoenix_default')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/networks/hello-phoenix_default HTTP/1.1" 200 444
compose.cli.verbose_proxy.proxy_callable: docker inspect_network -> {'Attachable': False,
 'ConfigFrom': {'Network': ''},
 'ConfigOnly': False,
 'Containers': {},
 'Created': '2018-12-17T03:43:10.29638438Z',
 'Driver': 'bridge',
 'EnableIPv6': False,
 'IPAM': {'Config': [{'Gateway': '172.18.0.1', 'Subnet': '172.18.0.0/16'}],
          'Driver': 'default',
          'Options': None},
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=hello-phoenix', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhello-phoenix%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=hellophoenix', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhellophoenix%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=hello-phoenix', 'com.docker.compose.service=db', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhello-phoenix%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 1253
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
 'Args': ['postgres'],
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['postgres'],
            'Domainname': '',
            'Entrypoint': ['docker-entrypoint.sh'],
            'Env': ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('postgres:10')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/images/postgres:10/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
 'Author': '',
 'Comment': '',
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['postgres'],
            'Domainname': '',
            'Entrypoint': ['docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=hello-phoenix', 'com.docker.compose.service=db', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhello-phoenix%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 1253
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.parallel.feed_queue: Pending: {<Service: db>}
compose.parallel.feed_queue: Starting producer thread for <Service: db>
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88')
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
 'Args': ['postgres'],
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['postgres'],
            'Domainname': '',
            'Entrypoint': ['docker-entrypoint.sh'],
            'Env': ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin',
...
Starting hello-phoenix_db_1 ...
compose.parallel.feed_queue: Pending: {<Container: hello-phoenix_db_1 (b83682)>}
compose.parallel.feed_queue: Starting producer thread for <Container: hello-phoenix_db_1 (b83682)>
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88', stdout=True, stderr=True, stream=True)
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "POST /v1.22/containers/b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88/attach?logs=0&stdout=1&stderr=1&stream=1 HTTP/1.1" 101 0
urllib3.connectionpool._new_conn: Starting new HTTPS connection (2): 192.168.99.100:2376
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker attach -> <docker.types.daemon.CancellableStream object at 0x000002D06A8B6E80>
compose.cli.verbose_proxy.proxy_callable: docker start <- ('b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88')
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "POST /v1.22/containers/b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88/start HTTP/1.1" 204 0
compose.cli.verbose_proxy.proxy_callable: docker start -> None
Starting hello-phoenix_db_1 ... done
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: db>
compose.parallel.feed_queue: Pending: set()
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('hello-phoenix_default')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/networks/hello-phoenix_default HTTP/1.1" 200 700
compose.cli.verbose_proxy.proxy_callable: docker inspect_network -> {'Attachable': False,
 'ConfigFrom': {'Network': ''},
 'ConfigOnly': False,
 'Containers': {'b836829fdd301812418fcf16cb276e823a18221486ce6a34c693e3f35cc21d88': {'EndpointID': '5ec69f797077fdb198a2be1c95ab078787c1452b32a7aa10b5760cfef40c5c26',
                                                                                     'IPv4Address': '172.18.0.2/16',
                                                                                     'IPv6Address': '',
                                                                                     'MacAddress': '02:42:ac:12:00:02',
                                                                                     'Name': 'hello-phoenix_db_1'}},
 'Created': '2018-12-17T03:43:10.29638438Z',
 'Driver': 'bridge',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('phoenix:1.4.0')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/images/phoenix:1.4.0/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
 'Author': 'Nicolas Bettenburg <nicbet@gmail.com>',
 'Comment': '',
 'Config': {'ArgsEscaped': True,
            'AttachStderr': False,
            'AttachStdin': False,
            'AttachStdout': False,
            'Cmd': ['mix', 'phx.server'],
            'Domainname': '',
            'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=hello-phoenix', 'com.docker.compose.service=app', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhello-phoenix%22%2C+%22com.docker.compose.service%3Dapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=hellophoenix', 'com.docker.compose.service=app', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dhellophoenix%22%2C+%22com.docker.compose.service%3Dapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (links=[], port_bindings={}, binds=['/c/Users/user/Projects/hello-phoenix/src:/app:rw'], volumes_from=[], privileged=False, network_mode='hello-phoenix_default', devices=None, dns=None, dns_opt=None, dns_search=None, restart_policy=None, runtime=None, cap_add=None, cap_drop=None, mem_limit=None, mem_reservation=None, memswap_limit=None, ulimits=None, log_config={'Type': '', 'Config': {}}, extra_hosts=None, read_only=None, pid_mode=None, security_opt=None, ipc_mode=None, cgroup_parent=None, cpu_quota=None, shm_size=None, sysctls=None, pids_limit=None, tmpfs=[], oom_kill_disable=None, oom_score_adj=None, mem_swappiness=None, group_add=None, userns_mode=None, init=None, init_path=None, isolation=None, cpu_count=None, cpu_percent=None, nano_cpus=None, volume_driver=None, cpuset_cpus=None, cpu_shares=None, storage_opt=None, blkio_weight=None, blkio_weight_device=None, device_read_bps=None, device_read_iops=None, device_write_bps=None, device_write_iops=None, mounts=None, device_cgroup_rules=None, cpu_period=None, cpu_rt_period=None, cpu_rt_runtime=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': ['/c/Users/user/Projects/hello-phoenix/src:/app:rw'],
 'Links': [],
 'LogConfig': {'Config': {}, 'Type': ''},
 'NetworkMode': 'hello-phoenix_default',
 'PortBindings': {},
 'VolumesFrom': []}
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (image='phoenix:1.4.0', ports=[], volumes={'/app': {}}, command=['mix', 'ecto.create'], tty=True, stdin_open=True, detach=False, name='hello-phoenix_app_run_165ee61ef3d2', environment=[], labels={'com.docker.compose.project': 'hello-phoenix', 'com.docker.compose.service': 'app', 'com.docker.compose.oneoff': 'True', 'com.docker.compose.slug': '165ee61ef3d201c91b0ac996055fdf87ef5a8dd636a84efb8287ab7e8591de8', 'com.docker.compose.version': '1.23.2'}, host_config={'NetworkMode': 'hello-phoenix_default', 'VolumesFrom': [], 'Binds': ['/c/Users/user/Projects/hello-phoenix/src:/app:rw'], 'PortBindings': {}, 'Links': [], 'LogConfig': {'Type': '', 'Config': {}}}, networking_config={'EndpointsConfig': {'hello-phoenix_default': {'Aliases': ['app'], 'IPAMConfig': {}}}})
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "POST /v1.22/containers/create?name=hello-phoenix_app_run_165ee61ef3d2 HTTP/1.1" 201 90
compose.cli.verbose_proxy.proxy_callable: docker create_container -> {'Id': '43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557',
 'Warnings': None}
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "GET /v1.22/containers/43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
 'Args': ['ecto.create'],
 'Config': {'AttachStderr': True,
            'AttachStdin': True,
            'AttachStdout': True,
            'Cmd': ['mix', 'ecto.create'],
            'Domainname': '',
            'Entrypoint': None,
            'Env': ['PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
                    'OTP_VERSION=21.2',
...
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network <- ('43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557', 'hello-phoenix_default')
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "POST /v1.22/networks/hello-phoenix_default/disconnect HTTP/1.1" 200 0
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network -> None
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network <- ('43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557', 'hello-phoenix_default', aliases=[], ipv4_address=None, ipv6_address=None, links=[], link_local_ips=None)
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "POST /v1.22/networks/hello-phoenix_default/connect HTTP/1.1" 200 0
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network -> None
compose.cli.main.call_docker: 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe' start --attach --interactive 43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557
** (SyntaxError) config/dev.exs:3: syntax error before: adapter
    (elixir) lib/code.ex:232: Code.eval_string/3
    (mix) lib/mix/config.ex:187: anonymous fn/2 in Mix.Config.__import__!/2
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix) lib/mix/config.ex:186: Mix.Config.__import__!/2
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
compose.cli.verbose_proxy.proxy_callable: docker remove_container <- ('43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557', force=True, v=True)
urllib3.connectionpool._make_request: https://192.168.99.100:2376 "DELETE /v1.22/containers/43b593436dd9226af6857bc548a449fe605a3c35e65d38e3da36bb1cf024f557?v=True&link=False&force=True HTTP/1.1" 204 0
compose.cli.verbose_proxy.proxy_callable: docker remove_container -> None

i found the config syntax error "syntax error before: adapter" in the output. and now i check docker ps for the state.

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORT
S                     NAMES
4ce8bd66e46f        6eb6c50a02e7        "docker-entrypoint.s…"   15 minutes ago      Up 15 minutes       0.0
.0.0:32768->5432/tcp   db
b836829fdd30        postgres:10         "docker-entrypoint.s…"   3 days ago          Up 57 seconds       543
2/tcp                  hello-phoenix_db_1

so , the problem is ./mix ecto.create to create a alias name hello-phoenix_db_1 container? but the file src/config/dev.exs hostname is db ? is that correct ? i am so confused A.A

i execute the docker-compose up, and the result as below

$ docker-compose up
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Starting hello-phoenix_db_1 ... done
Starting hello-phoenix_app_1 ... done
Attaching to hello-phoenix_db_1, hello-phoenix_app_1
db_1   | 2018-12-25 02:50:53.180 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2018-12-25 02:50:53.180 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2018-12-25 02:50:53.187 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2018-12-25 02:50:53.206 UTC [20] LOG:  database system was shut down at 2018-12-25 02:50:46 UTC
app_1  | ** (SyntaxError) config/dev.exs:3: syntax error before: adapter
app_1  |     (elixir) lib/code.ex:232: Code.eval_string/3
app_1  |     (mix) lib/mix/config.ex:187: anonymous fn/2 in Mix.Config.__import__!/2
app_1  |     (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
app_1  |     (mix) lib/mix/config.ex:186: Mix.Config.__import__!/2
app_1  |     (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
hello-phoenix_app_1 exited with code 1
nicbet commented 5 years ago

Could you paste the contents of your config/dev.exs?

The logs show this error:

** (SyntaxError) config/dev.exs:3: syntax error before: adapter
gofighting123 commented 5 years ago

Could you paste the contents of your config/dev.exs?

The logs show this error:

** (SyntaxError) config/dev.exs:3: syntax error before: adapter
# Configure your database
config :test, Test.Repo
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "test_dev",
  hostname: "db",
  pool_size: 10
gofighting123 commented 5 years ago

should i give up trying build this docker in my win10-Docker Quickstart Terminal ? and just build a ubuntu container and build it inside ? that what i think better way to solve this problem quickly.

gofighting123 commented 5 years ago

it seems like i had a typo in the first line of dev.exs... i have no comma in the end of Repo, sorry , my fault :(

gofighting123 commented 5 years ago

也因此,底層是使用 Linux API 的 Docker 容器,是不能拿到 Windows 上面跑的。 但相同的,使用 Windows API 這種底層的 Docker Container, 就可以在上面執行 IIS,SQL Server Express 等等。 the document from here said if the container build from linux API docker can't port and run on the Win10 docker, is that right ?

nicbet commented 5 years ago

@gofighting123 with the typo in dev.exs fixed I am assuming this issue resolved.

gofighting123 commented 5 years ago

OK, thanks.