[Bug]: Unable to setup container for the image bitnami/redis:7.4.2 #10002
Unanswered
SivaGurijala79
asked this question in
Q&A
Replies: 1 comment
-
Any suggestion for this query? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Module
Core
Testcontainers version
1.17.2
Using the latest Testcontainers version?
Yes
Host OS
Mac
Host Arch
2.6 GHz 6-Core Intel Core i7 (x86_64)
Docker version
Client: Docker Engine - Community Version: 27.1.2 API version: 1.46 Go version: go1.22.6 Git commit: d01f264bcc Built: Mon Aug 12 11:34:32 2024 OS/Arch: darwin/amd64 Context: default Server: Docker Engine - Community Engine: Version: 27.1.1 API version: 1.46 (minimum version 1.24) Go version: go1.21.12 Git commit: cc13f95 Built: Tue Jul 23 19:57:14 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.19 GitCommit: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41 runc: Version: 1.7.19 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
What happened?
I am trying to setup a redis container with SSL. Since official redis image is not having the ssl support, i am using bitnami/redis:7.4.2 image.
I am using Java 21, Springboot: 3.4.2 version
i generated self signed openssl certificates and using them.
I am able to run the conatiner manually with following command and can interact with same using below springboot props
spring.data.redis.host=localhost
spring.data.redis.port=6380
spring.data.redis.password=redis
spring.data.redis.ssl.enabled=true
and disabled the peerverificationfrom springboot app. Local run of springboot application is workign fine.
When i am tryign to setup the container for integration tests using test containers using following code i am running into issue.
int PORT = 6380;
@container
GenericContainer<?> redisContainer =
new GenericContainer(DockerImageName.parse(REDIS_IMAGE_NAME)).withExposedPorts(PORT)
.withCopyFileToContainer(
MountableFile.forClasspathResource("redis-certs/redis.crt"), "/certs/redis.crt")
.withCopyFileToContainer(
MountableFile.forClasspathResource("redis-certs/redis.key"), "/certs/redis.key")
.withCopyFileToContainer(
MountableFile.forClasspathResource("redis-certs/ca.crt"), "/certs/ca.crt")
.withCopyFileToContainer(
MountableFile.forClasspathResource("redis-certs/redis.dh"), "/certs/redis.dh")
.withEnv("REDIS_PASSWORD", "redis")
.withEnv("REDIS_TLS_ENABLE", "yes")
.withEnv("REDIS_TLS_AUTH_CLIENTS", "no")
.withEnv("REDIS_TLS_PORT", "6380")
.withEnv("REDIS_TLS_CERT_FILE", "/certs/redis.crt")
.withEnv("REDIS_TLS_KEY_FILE", "/certs/redis.key")
.withEnv("REDIS_TLS_CA_FILE", "/certs/ca.crt")
.withEnv("REDIS_TLS_DH_PARAMS_FILE", "/certs/redis.dh");
Kindly help me to setup the redis container with ssl support for integration tests in springboot app.
Relevant log output
Additional Information
image link : https://hub.docker.com/r/bitnami/redis
Beta Was this translation helpful? Give feedback.
All reactions