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

Failed to start the container in AWS code build #386

Open
nicofari opened this issue Aug 10, 2023 · 0 comments
Open

Failed to start the container in AWS code build #386

nicofari opened this issue Aug 10, 2023 · 0 comments

Comments

@nicofari
Copy link

Hello

I have a kotlin project which uses atmoz/sftp via testcontainers (genericcontainer actually) to run a couple of tests.
These run fine locally.
On AWS code build though I get this error:

15:21:54.885 DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/243c4037269bfcd0cbcdab0351b72118eaa7bbc80fc1b3e020a1e510d29922b5/json], queryParams={}}

1156 | 15:21:54.935 DEBUG org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 243c4037269bfcd0cbcdab0351b72118eaa7bbc80fc1b3e020a1e510d29922b5,false
1157 | 15:21:54.935 DEBUG org.testcontainers.shaded.com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: DefaultWebTarget{path=[/containers/243c4037269bfcd0cbcdab0351b72118eaa7bbc80fc1b3e020a1e510d29922b5/json], queryParams={}}
1158 | 15:21:54.995 ERROR tc.atmoz/sftp:latest - Could not start container

Below the cause seems this (not sure at all):

15:21:55.051 ERROR tc.atmoz/sftp:latest - Log output from the failed container:

1255 | exec /entrypoint: exec format error

After lot of attempts I create the container this way:

    GenericContainer("atmoz/sftp:latest")
        .withCopyFileToContainer(
            MountableFile.forHostPath("$remoteFolderPath/", 511),
            "/home/foo"
        )
        .withCreateContainerCmdModifier { cmd -> cmd.withPlatform("linux/amd64") }
        .withExposedPorts(hostPort)
        .withCommand("$username:$password").use { sftpServer ->

I've added the line with "withPlatform" trying to fix but it does not work
I've tried with linux/arm64 too but same results.

Any idea?

tia

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

1 participant