# Issue with docker run

**URL:** <https://forums.docker.com/t/issue-with-docker-run/142210>\
**Category:** Testcontainers\
**Tags:** docker\
**Created:** [June 28, 2024, 2:52pm UTC](https://forums.docker.com/t/issue-with-docker-run/142210 "2024-06-28T14:52:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![22021987](https://avatars.discourse-cdn.com/v4/letter/2/ee7513/32.png) [@22021987](https://forums.docker.com/u/22021987)\
**Post date:** [June 28, 2024, 2:52pm UTC](https://forums.docker.com/t/issue-with-docker-run/142210/1 "2024-06-28T14:52:12Z")

</div>

Hello there,

I am trying to run docker after building the image, however, I could not run it.

My application (Java) uses the Test container - MySQL.

This is the Dockerfile:

```auto
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY ./target/gen-test9-0.0.1-SNAPSHOT.jar /app/gen-test9.jar
EXPOSE 8088
ENTRYPOINT ["java","-jar","gen-test9.jar"]

```

After that, I run with the command:

```auto
docker run -it --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -e TESTCONTAINERS_RYUK_DISABLED=true -p 8080:8080 gen-test9:latest

```

I got an error:

 ![image](https://global.discourse-cdn.com/docker/original/3X/2/b/2ba338c2824c46e0e56c92512453f2aa49a69768.jpeg)

How can I fix this issue, pls help me.  
Thanks

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/bluepuma77/32/32688_2.png) [@bluepuma77](https://forums.docker.com/u/bluepuma77)\
**Post date:** [June 28, 2024, 7:14pm UTC](https://forums.docker.com/t/issue-with-docker-run/142210/2 "2024-06-28T19:14:14Z")

</div>

It seems your container Java app is using Docker API to work with Docker MySQL.

Not sure what your app is doing, you would need to provide more details.

---

<div class="post-metadata">

**Author:** ![22021987](https://avatars.discourse-cdn.com/v4/letter/2/ee7513/32.png) [@22021987](https://forums.docker.com/u/22021987)\
**Post date:** [June 29, 2024, 12:55am UTC](https://forums.docker.com/t/issue-with-docker-run/142210/3 "2024-06-29T00:55:01Z")

</div>

Thanks for replying to me. In this case, my application (Java) started using the Test container (MySQL) instead of using MySQL locally.

You can see the lib in the POM.xml file

```auto
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>jdbc</artifactId>
</dependency>
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>mysql</artifactId>
</dependency>

```

This is the image that I ran this application with the command: ./mvnw → It works well

 ![image](https://global.discourse-cdn.com/docker/original/3X/2/7/27a33d1fff460fb10a0681219f7fb16577bdf919.jpeg)  
However, I tried to build a docker image and run on it and got an error.
