mirror of
https://github.com/docker/compose.git
synced 2025-07-31 01:24:15 +02:00
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:
parent
553865f294
commit
3dddbcd7df
@ -129,7 +129,7 @@ func ToContainerGroup(ctx context.Context, aciContext store.AciContext, p types.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getDNSSidecar(containers []containerinstance.Container) containerinstance.Container {
|
func getDNSSidecar(containers []containerinstance.Container) containerinstance.Container {
|
||||||
var names []string
|
names := []string{"/hosts"}
|
||||||
for _, container := range containers {
|
for _, container := range containers {
|
||||||
names = append(names, *container.Name)
|
names = append(names, *container.Name)
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ func TestComposeContainerGroupToContainerWithDnsSideCarSide(t *testing.T) {
|
|||||||
assert.Equal(t, *(*group.Containers)[1].Name, "service2")
|
assert.Equal(t, *(*group.Containers)[1].Name, "service2")
|
||||||
assert.Equal(t, *(*group.Containers)[2].Name, ComposeDNSSidecarName)
|
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)[0].Image, "image1")
|
||||||
assert.Equal(t, *(*group.Containers)[1].Image, "image2")
|
assert.Equal(t, *(*group.Containers)[1].Image, "image2")
|
||||||
|
@ -18,5 +18,4 @@ COPY . .
|
|||||||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/hosts main/main.go
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/hosts main/main.go
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /go/bin/hosts /hosts
|
COPY --from=builder /go/bin/hosts /hosts
|
||||||
ENTRYPOINT ["/hosts"]
|
|
Loading…
x
Reference in New Issue
Block a user