RichardKnop / go-oauth2-server

A standalone, specification-compliant, OAuth2 server written in Golang.
Mozilla Public License 2.0
2.12k stars 315 forks source link

Docker container not starting #46

Open icemagno opened 6 years ago

icemagno commented 6 years ago

Commands:

1) git clone https://github.com/RichardKnop/go-oauth2-server.git

2) cd go-oauth2-server/

3) docker build -t go-oauth2-server:latest .

4) docker run -e ETCD_ENDPOINTS=localhost:2379 -p 8070:8080 --name go-oauth2-server go-oauth2-server:latest

Result:

Postgres is up - executing command:
NAME:
   go-oauth2-server - Go OAuth 2.0 Server

USAGE:
   go-oauth2-server [global options] command [command options] [arguments...]

VERSION:
   0.0.0

AUTHOR:
   Richard Knop <risoknop@gmail.com>

COMMANDS:
     migrate    run migrations
     loaddata   load data from fixture
     runserver  run web server
     help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --configBackend value  (default: "etcd")
   --help, -h             show help
   --version, -v          print the version

But the container is not running:

docker exec go-oauth2-server /go/bin/go-oauth2-server loaddata \
>   oauth/fixtures/scopes.yml \
>   oauth/fixtures/roles.yml \
>   oauth/fixtures/test_clients.yml

Error response from daemon: Container 1a61b8dfdc65cf13f91edd5d7f2ab954215e38f20e8cda629c94ed8adf034930 is not running

What I have done wrong ?

icemagno commented 6 years ago

By the way what must be runnning at localhost:2379 ?

After start the container using command \bin\bash

app@1a61b8dfdc65:/go/src/github.com/RichardKnop/go-oauth2-server$ go-oauth2-server runserver
INFO: 2018/05/17 13:18:10 etcd.go:90 ETCD Endpoints: localhost:2379
FATAL: 2018/05/17 13:18:15 factory.go:71 dial tcp 127.0.0.1:2379: connect: connection refused
app@1a61b8dfdc65:/go/src/github.com/RichardKnop/go-oauth2-server$
icemagno commented 6 years ago

Ok. Can run all now after use the docker compose option. All its fine.

How can I create clients ?