Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Compose and Wait seems not working #1792

Open
grrolland opened this issue Jun 14, 2024 · 2 comments
Open

External Compose and Wait seems not working #1792

grrolland opened this issue Jun 14, 2024 · 2 comments

Comments

@grrolland
Copy link

Description

When using external docker compose as :

version: "2.0"
services:
  minio:
    image: quay.io/minio/minio
    restart: always
    environment:
      - MINIO_ROOT_USER=xxxxx
      - MINIO_ROOT_PASSWORD=xxxxx
    ports:
      - 19000:9000
      - 19001:9001
    command: ["server", "/data", "--console-address", ":9001"]
  mc:
    image: quay.io/minio/mc
    depends_on:
      - minio
    volumes:
      - ./files:/data
    links:
      - "minio:minio"
    entrypoint: "/bin/sh /data/init.sh"
  mc-end:
      image: quay.io/minio/mc
      entrypoint: "/bin/sh echo"
      depends_on:
          mc:
              condition: service_completed_successfully

And configuration as :

 <configuration>
    <images>
        <image>
            <alias>test-env</alias>
            <name>test-env</name>
            <external>
                <type>compose</type>
                <basedir>test-env</basedir>
                <composeFile>docker-compose.yml</composeFile>
            </external>
            <run>
                <wait>
                    <time>3600000</time>
                </wait>
            </run>
        </image>
    </images>
    <showLogs>true</showLogs>
</configuration>

Here I expect :

  • start the minio image
  • start the mc client with init script executed
  • wait for mc image completed wit mc-end

When the init.sh from the mc container run for a long time (more than 10s), I have this error :

DOCKER> I/O Error [[quay.io/minio/mc:latest] "mc": Timeout after 10287 ms while waiting on exit code 0]

The wait configuration seems to ne be applied

Info

  • docker-maven-plugin version : 0.44.0
  • Maven version (mvn -v) : Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
  • Docker version : Docker version 25.0.3, build 4debf41
@FelipeGXavier
Copy link

Same issue here

@marcelcamporelli
Copy link

We have the same issue.

In Version 0.40.1, the following works as expected.

In Version 0.45.1, the wait is ignored.

 <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.45.1</version>
        <configuration>
          <showLogs>false</showLogs>
          <containerNamePattern>%a</containerNamePattern>
          <images>
            <image>
              <alias>(our image name)</alias>
              <external>
                <type>compose</type>
                <basedir>.</basedir>
                <composeFile>docker-compose-pg-test.yml</composeFile>
              </external>
              <run>
                <containerNamePattern>%a</containerNamePattern>
                <wait>
                  <time>60000</time>
                </wait>
              </run>
            </image>
          </images>
        </configuration>
        <executions>
          <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>stop</goal>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>stop</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants