diff --git a/.dockerignore b/.dockerignore index e589eea63c..c085529283 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -.git bin skywire ci_scripts diff --git a/docker/images/visor/Dockerfile b/docker/images/visor/Dockerfile index bf96f41c16..17c95287f2 100644 --- a/docker/images/visor/Dockerfile +++ b/docker/images/visor/Dockerfile @@ -6,14 +6,13 @@ ARG BUILDINFO_LDFLAGS ARG CGO_ENABLED=0 ENV CGO_ENABLED=${CGO_ENABLED} \ GOOS=linux \ - GOARCH=amd64 \ GO111MODULE=on COPY . /skywire WORKDIR /skywire -RUN apk add --no-cache make && \ +RUN apk add --no-cache make git && \ sh -c /skywire/docker/images/visor/install-preq.sh && \ make host-apps && \ make build-deploy && \ diff --git a/docker/images/visor/install-preq.sh b/docker/images/visor/install-preq.sh index 8867903719..8c8293c825 100755 --- a/docker/images/visor/install-preq.sh +++ b/docker/images/visor/install-preq.sh @@ -1,13 +1,13 @@ #!/bin/sh -if type apt > /dev/null; then - apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* +if type apt >/dev/null; then + apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates && + rm -rf /var/lib/apt/lists/* fi -if type apk > /dev/null; then - apk update - apk add --no-cache ca-certificates openssl iproute2 bash - update-ca-certificates --fresh +if type apk >/dev/null; then + apk update + apk add --no-cache ca-certificates openssl iproute2 bash + update-ca-certificates --fresh fi diff --git a/pkg/transport/network/addrresolver/client.go b/pkg/transport/network/addrresolver/client.go index f40ce9dbc1..286e114c20 100644 --- a/pkg/transport/network/addrresolver/client.go +++ b/pkg/transport/network/addrresolver/client.go @@ -407,10 +407,9 @@ func (c *httpClient) Close() error { if err := c.sudphConn.Close(); err != nil { c.log.WithError(err).Errorf("Failed to close SUDPH") } + close(c.closed) } - close(c.closed) - return nil } diff --git a/pkg/visor/visorconfig/parse.go b/pkg/visor/visorconfig/parse.go index ba449fefad..2a51c74e5a 100644 --- a/pkg/visor/visorconfig/parse.go +++ b/pkg/visor/visorconfig/parse.go @@ -58,6 +58,7 @@ func parseV1(cc *Common, raw []byte) (*V1, error) { if err := conf.ensureKeys(); err != nil { return nil, fmt.Errorf("%v: %w", ErrInvalidSK, err) } + conf = ensureAppDisc(conf) conf = updateUrls(conf) conf.Version = V1Name return conf, conf.flush(conf) @@ -158,6 +159,16 @@ func parseV0(cc *Common, raw []byte) (*V1, error) { return conf, conf.flush(conf) } + +func ensureAppDisc(conf *V1) *V1 { + if conf.Launcher.Discovery == nil { + conf.Launcher.Discovery = &V1AppDisc{ + ServiceDisc: skyenv.DefaultServiceDiscAddr, + } + } + return conf +} + func updateUrls(conf *V1) *V1 { if conf.Dmsg.Discovery == skyenv.OldDefaultDmsgDiscAddr { conf.Dmsg.Discovery = skyenv.DefaultDmsgDiscAddr