Open JoVanMontfort opened 1 year ago
Can you try using latest podman version?
Can we use already podman 4.3.1 in RHEL-8 ... https://access.redhat.com/discussions/6984773#:~:text=The%20current%20podman%20version%20in,1.
podman v 4.4.1 doesn't solve the problem
I also have the same issue, and testing with Podman 4.6.0 we still get this.
I could fix the issue by overriding the configure method of the MySQLContainer file and removing the lchown execution. It's not a permanent fix, but MySQL will run.
public class MysqlTestContainerConfig extends MySQLContainer<MysqlTestContainerConfig> {
private static final String MYSQL_ROOT_USER = "root";
MysqlTestContainerConfig(String image) {
super(image);
}
@Override
protected void configure() {
addEnv("MYSQL_DATABASE", databaseName);
if (!MYSQL_ROOT_USER.equalsIgnoreCase(username)) {
addEnv("MYSQL_USER", username);
}
if (password != null && !password.isEmpty()) {
addEnv("MYSQL_PASSWORD", password);
addEnv("MYSQL_ROOT_PASSWORD", password);
} else if (MYSQL_ROOT_USER.equalsIgnoreCase(username)) {
addEnv("MYSQL_ALLOW_EMPTY_PASSWORD", "yes");
} else {
throw new ContainerLaunchException("Empty password can be used only with the root user");
}
setStartupAttempts(3);
}
}
@eddumelendez apologize for my ignorance. Could you clarify why the MySQL container is creating a volume for the /etc/mysql/conf.d
config?
@magnuspedro how to use this configuration class? Spring config, ... ?
This issue is happening for us with Ubuntu 22.04 with Clojure and kaocha where we are using testcontainer for running tests locally that spins up MySQL. It however works with Gitlab pipeline. This is really blocker for us. The same setup works on a mac.
I have tried overriding the MySQLContainer
from Clojure side using proxy
but it is not working. I don't get any error at this time, but the tests get stuck. I am also not able trace any logs because I couldn't find a way to enable printing logs in kaocha.
Kindly requesting your input on how to solve this. Thanks.
@jsloop42 Which version of docker are you using on Ubuntu vs Mac?
@JoVanMontfort You will use the MysqlTestContainerConfig as the container starter.
@jsloop42 Which version of docker are you using on Ubuntu vs Mac?
On macOS, the docker version is:
Docker version 26.1.4, build 5650f9b
On Ubuntu, the docker version is:
Docker version 27.0.3, build 7d4bcd8
@jsloop42 This issue is about Podman, but you are reporting here different Docker versions. If you are using Docker and see a similar issue, please open a dedicated issue for it.
For Podman users, does this issue still persist with recent versions of Testcontainers and Podman? If yes, that means that likely the copy
API behaves differently for Podman and an issue should be created with the Podman team.
Module
Core
Testcontainers version
1.18.3
Using the latest Testcontainers version?
Yes
Host OS
RHEL8
Host Arch
x86
Docker version
What happened?
mysqltestcontainer-cant-chown-etc-mysql-conf-d-folder-inside-rootless-podman-container
Relevant log output
Additional Information
mysqltestcontainer-cant-chown-etc-mysql-conf-d-folder-inside-rootless-podman-container