diff --git a/aci/convert/convert.go b/aci/convert/convert.go index 31c71955f..532df6787 100644 --- a/aci/convert/convert.go +++ b/aci/convert/convert.go @@ -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) } diff --git a/aci/convert/convert_test.go b/aci/convert/convert_test.go index fcacfd6b2..9917edbf9 100644 --- a/aci/convert/convert_test.go +++ b/aci/convert/convert_test.go @@ -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") diff --git a/aci/etchosts/Dockerfile b/aci/etchosts/Dockerfile index da243fc30..b7e0f5497 100644 --- a/aci/etchosts/Dockerfile +++ b/aci/etchosts/Dockerfile @@ -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 \ No newline at end of file