Waziup / WaziGate

Waziup LoRa Edge gateway
21 stars 20 forks source link

Docker image build error - DNS issue #140

Closed j-forster closed 2 years ago

j-forster commented 3 years ago

Building wazigate-lora fails on my setup, using a Wazigate 2.1.7 base image:

pi@wazigate:~ $ cd waziup-gateway/apps/waziup/wazigate-lora/
pi@wazigate:~/waziup-gateway/apps/waziup/wazigate-lora $ docker-compose build --no-cache wazigate-lora
Building wazigate-lora
Step 1/18 : FROM golang:1.13-alpine AS development
...
Step 8/18 : RUN apk add --no-cache ca-certificates git zip     && cd /zip/     && zip -q -r /app/index.zip .     && cd /app     && go build -a -installsuffix cgo -ldflags "-s -w" -o wazigate-lora ./cmd/wazigate-lora
...
Step 10/18 : FROM alpine:latest AS production
...
Step 12/18 : RUN apk --no-cache add ca-certificates curl
 ---> Running in dad1d2ebfe67
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1913:
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: Permission denied
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/armv7/APKINDEX.tar.gz
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time:crypto/asn1/a_time.c:330:
1995793296:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1913:
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/community: Permission denied
ERROR: unable to select packages:
  ca-certificates (no such package):
    required by: world[ca-certificates]
  curl (no such package):
    required by: world[curl]
ERROR: Service 'wazigate-lora' failed to build: The command '/bin/sh -c apk --no-cache add ca-certificates curl' returned a non-zero code: 2

It's a DNS issue, as no hosts can be resolved from the container (tested using ping). This only happens at the "production" stage, not at the "development" stage - e.g. Step 8/18 works fine! I tried changing the the etc/resolve.conf on my RPi, but the issue didn't change. There is no issue for @mojtaba-esk's setup!

cdupont commented 2 years ago

closing as too old