Skip to content

Commit 5cf4e6d

Browse files
author
Stephen Gutekanst
committed
install bind-tools in Alpine base to prevent DNS failure
1 parent 0f33644 commit 5cf4e6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

godockerize.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ func doBuild(c *cli.Context) error {
161161
echo -e "http://dl-cdn.alpinelinux.org/alpine/%s/community\n" >> /etc/apk/repositories
162162
`, repos[i], repos[i])
163163
}
164+
if strings.HasPrefix(c.String("base"), "alpine") {
165+
// IMPORTANT: Alpine by default does not come with some packages that
166+
// are needed for working DNS to other containers on a user-defined
167+
// Docker network. Without installing this package, nslookup and Go etc
168+
// will fail to contact other Docker containers.
169+
// See https://github.com/sourcegraph/deploy-sourcegraph-docker/issues/1
170+
install = append(install, "bind-tools")
171+
}
164172
if len(install) != 0 {
165173
fmt.Fprintf(&dockerfile, " RUN apk add --no-cache %s\n", strings.Join(sortedStringSet(install), " "))
166174
}

0 commit comments

Comments
 (0)