We need to pass the full command and not rely on ENTRYPOINT for ACI containers, ACI overrides the ENTRYPOINT with commands.

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Guillaume Tardif 2020-10-26 15:03:37 +01:00
parent 553865f294
commit 3dddbcd7df
3 changed files with 3 additions and 4 deletions

View File

@ -129,7 +129,7 @@ func ToContainerGroup(ctx context.Context, aciContext store.AciContext, p types.
}
func getDNSSidecar(containers []containerinstance.Container) containerinstance.Container {
var names []string
names := []string{"/hosts"}
for _, container := range containers {
names = append(names, *container.Name)
}

View File

@ -179,7 +179,7 @@ func TestComposeContainerGroupToContainerWithDnsSideCarSide(t *testing.T) {
assert.Equal(t, *(*group.Containers)[1].Name, "service2")
assert.Equal(t, *(*group.Containers)[2].Name, ComposeDNSSidecarName)
assert.DeepEqual(t, *(*group.Containers)[2].Command, []string{"service1", "service2"})
assert.DeepEqual(t, *(*group.Containers)[2].Command, []string{"/hosts", "service1", "service2"})
assert.Equal(t, *(*group.Containers)[0].Image, "image1")
assert.Equal(t, *(*group.Containers)[1].Image, "image2")

View File

@ -18,5 +18,4 @@ COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/hosts main/main.go
FROM scratch
COPY --from=builder /go/bin/hosts /hosts
ENTRYPOINT ["/hosts"]
COPY --from=builder /go/bin/hosts /hosts