0

I'd like to run stilliard/pure-ftpd through maven. So when I run mvn clean install the docker image will spin up and my IT tests can communicate with the docker images.

This is how my pom.xml.file looks like

<plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-it</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <images>
                                <image>
                                    <alias>rabbitmq</alias>
                                    <name>rabbitmq:3-management-alpine</name>
                                    <run>
                                        <ports>
                                            <port>${rabbitmq.port}:5672</port>
                                            <port>${rabbitmq-management.port}:15672</port>
                                        </ports>
                                        <wait>
                                            <http>
                                                <url>http://${rabbitmq.host}:${rabbitmq-management.port}</url>
                                                <method>GET</method>
                                                <status>200..399</status>
                                            </http>
                                            <time>30000</time>
                                        </wait>
                                    </run>
                                </image>
                                <image>
                                    <alias>sftp</alias>
                                    <name>stilliard/pure-ftpd</name>
                                    <run>
                                        <cmd>${sftp.username}:${sftp.password}:::${sftp.directory}</cmd>
                                        <ports>
                                            <port>${sftp.port}:21</port>
                                        </ports>
                                        <wait>
                                            <time>10000</time>
                                        </wait>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </execution>
                    <execution>
                        <id>remove-it</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Everything starts except the ftp server. I get this message when I run mvn clean install

[INFO] DOCKER> [stilliard/pure-ftpd] "sftp": Start container c40ccb9d35e7
[ERROR] DOCKER> Error occurred during container startup, shutting down...
[INFO] DOCKER> [rabbitmq:3-management-alpine] "rabbitmq": Stop and removed container afbc982dc61b after 0 ms
[ERROR] DOCKER> I/O Error

What am I missing so that I can get stilliard/pure-ftpd start.

breaktop
  • 1,899
  • 4
  • 37
  • 58

1 Answers1

0

I am not sure what you meant with

<cmd>${sftp.username}:${sftp.password}:::${sftp.directory}</cmd>

but it doesn't look like a valid command for the container. If you take a look at the Dockerfile the command is executed with /bin/bash -c "your command here"

If your intention was to run the server and connect with a user and password the following will do the job:

<images>
  <image>
    <alias>sftp</alias>
    <name>stilliard/pure-ftpd</name>
    <run>
      <env>
        <FTP_USER_NAME>sw</FTP_USER_NAME>
        <FTP_USER_PASS>pass</FTP_USER_PASS>
        <FTP_USER_HOME>/home/sw</FTP_USER_HOME>
      </env>
      <ports>
        <port>3000:21</port>
        <port>30000:30000</port>
        <port>30001:30001</port>
        <port>30002:30002</port>
        <port>30003:30003</port>
        <port>30004:30004</port>
        <port>30005:30005</port>
        <port>30006:30006</port>
        <port>30007:30007</port>
        <port>30008:30008</port>
        <port>30009:30009</port>
      </ports>
      <wait>
        <time>10000</time>
      </wait>
    </run>
  </image>
</images>

It sets the runtime FTP user (see section Setting runtime FTP user of the readme and password.You need to open the 30000-30009 ports to make ftp passive mode work.

Run ftp -p localhost 3000 on host check it works. Hope it helps.

b0gusb
  • 4,283
  • 2
  • 14
  • 33