PacktPublishing / Hands-On-Restful-Web-services-with-Go

Hands-On Restful Web services with Go by Packt Publishing
MIT License
108 stars 73 forks source link

chapter12 docker nginx configuration raise an error #26

Closed kildem closed 3 years ago

kildem commented 4 years ago

When I run make on chapter12/deploySetup directory I receive an error. This are the logs:

Attaching to deploysetup_app_1, deploysetup_nginx_1
nginx_1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_1  | 10-listen-on-ipv6-by-default.sh: error: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_1  | /docker-entrypoint.sh: Configuration complete; ready for start up

There is this error: nginx_1 | 10-listen-on-ipv6-by-default.sh: error: /etc/nginx/conf.d/default.conf is not a file or does not exist

narenaryan commented 4 years ago

@kildem on which operating system you are running the code?

kildem commented 4 years ago

macOS Catalina

narenaryan commented 3 years ago

Hi @kildem, I ran the make command in the project and see no issues.

Docker version 20.10.0, build 7287ab3 docker-compose version 1.27.4, build 40524192 OS: Mac OS Catalina 10.15.5

See the output below.

`Hands-On-Restful-Web-services-with-Go/chapter12/deploySetup on  develop [!] ❯ make make build && make deploy Building the book server binary... cd bookServer && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "app" -v runtime/internal/sys internal/race runtime/internal/math unicode unicode/utf8 encoding math/bits unicode/utf16 container/list crypto/internal/subtle crypto/subtle vendor/golang.org/x/crypto/cryptobyte/asn1 internal/cpu runtime/internal/atomic sync/atomic internal/nettrace internal/testlog vendor/golang.org/x/crypto/internal/subtle internal/bytealg vendor/golang.org/x/crypto/curve25519 math runtime internal/reflectlite sync internal/singleflight math/rand errors sort internal/oserror io strconv syscall bytes strings bufio hash hash/crc32 crypto/internal/randutil reflect crypto crypto/hmac crypto/rc4 vendor/golang.org/x/net/dns/dnsmessage vendor/golang.org/x/crypto/hkdf vendor/golang.org/x/text/transform path internal/syscall/unix time context internal/poll os path/filepath internal/fmtsort encoding/binary net fmt io/ioutil encoding/base64 crypto/cipher crypto/sha512 crypto/aes crypto/des crypto/ed25519/internal/edwards25519 crypto/md5 crypto/sha1 crypto/sha256 log encoding/json compress/flate math/big compress/gzip encoding/hex encoding/pem net/url vendor/golang.org/x/crypto/internal/chacha20 vendor/golang.org/x/crypto/poly1305 vendor/golang.org/x/sys/cpu vendor/golang.org/x/crypto/chacha20poly1305 vendor/golang.org/x/text/unicode/bidi vendor/golang.org/x/text/unicode/norm vendor/golang.org/x/text/secure/bidirule vendor/golang.org/x/net/http2/hpack crypto/rand crypto/elliptic encoding/asn1 crypto/ed25519 crypto/ecdsa crypto/rsa crypto/dsa crypto/x509/pkix vendor/golang.org/x/crypto/cryptobyte mime vendor/golang.org/x/net/idna net/textproto mime/quotedprintable net/http/internal mime/multipart crypto/x509 vendor/golang.org/x/net/http/httpproxy vendor/golang.org/x/net/http/httpguts crypto/tls net/http/httptrace net/http docker-compose rm -f No stopped containers

Remove -d to run containers in fore-ground

docker-compose up --build -d Creating network "deploysetup_app-network" with driver "bridge" Building app Step 1/4 : FROM alpine latest: Pulling from library/alpine 05e7bc50f07f: Pull complete Digest: sha256:a126728cb7db157f0deb377bcba3c5e473e612d7bafc27f6bb4e5e083f9f08c2 Status: Downloaded newer image for alpine:latest ---> b14afc6dfb98 Step 2/4 : WORKDIR /go/bin/ ---> Running in 045412b0bb4a Removing intermediate container 045412b0bb4a ---> dd8a9cfc6951 Step 3/4 : COPY app . ---> a97bcf8aa21a Step 4/4 : CMD ["./app"] ---> Running in c9fbc1f35098 Removing intermediate container c9fbc1f35098 ---> e2034ab701c9

Successfully built e2034ab701c9 Successfully tagged deploysetup_app:latest Pulling nginx (nginx:alpine)... alpine: Pulling from library/nginx 05e7bc50f07f: Already exists dd545d53ef58: Pull complete 17698cdd4786: Pull complete b9cca7ed8a78: Pull complete 0f5e014b83d8: Pull complete Digest: sha256:fae856585e1353f215c40b3b5e50a8c3984fa0b0c306ada8a49e72d7bebe2872 Status: Downloaded newer image for nginx:alpine Creating deploysetup_app_1 ... done Creating deploysetup_nginx_1 ... done`

kildem commented 3 years ago

I have tried it now, and it works. But I have a new docker version now and new OS version. Long time has passed since I found this issue :)

narenaryan commented 3 years ago

No problem @kildem, I want to make sure that it works for you. I am closing this issue, have a great day.