Problem with starting Docker container in 2022.1 Follow
I just updated Intellij to build #IU-221.5080.210. We use multiple Docker containers in our project. When i try to start a single Docker container by clicking "Run" on the yml file in the Project Explorer, IntelliJ runs Docker Compose for all containers which where running in a previoous IntelliJ session. How can I prevent this?
Please sign in to leave a comment.
>When i try to start a single Docker container by clicking "Run" on the yml file in the Project Explorer, IntelliJ runs Docker Compose for all containers
Please attach a screenshot.
>How can I prevent this?
You can change the Docker run configuration parameters to start only services you need. See Docker run configurations.
I start the container like this:
and the build log shows this:
and the generated run configuration looks like this:
Doing the same in IntelliJ 2021.x would start only the selected. With an explicit run configuration only the configured containers are started. Could it be that you changed the behavior of the run configuration? I noticed the "Leave empty to run all services" in the Service field. Unfortunately i don't have access to an 2021.x Version of IntelliJ so i can't check if there is a difference.
Thank you for the information. The 2021.3.3 version has the same behaviour: when the field is empty it runs all the services. The command is the same:
Hm.. I see same behaviour for 2022.1 and 2021.3 versions.
Btw if needed, previous versions can be found at https://www.jetbrains.com/idea/download/other.html
was this behavior change made consciously or is it a bug?
I'm not aware of the specific changes in this area. Can you confirm that if you run the same run configuration in previous version - it will run only one service? What service is this? Thanks.
I don't use a specific run configuration. When I use the run command from the conrtext menu, a temporary configuration is generated by IntelliJ (as far as i know).
I Just found a VM with 2021.3.1 installed. When I start the docker image here, the generated configuration is different. The compose file is filled:
>When I start the docker image here, the generated configuration is different.
Could you clarify what is different? I see the same vales are used. Does it run only specific service?
Btw, have you deleted the existing configuration (if it exists) before running? Otherwise IDE will re-use previously existing run configuration.
The difference is in "Compose files". In 2022.1 it looks like this:
What is different on this picture? I see identical data and the behaviour.
Do you get different behaviour with 2021.3.1 when you run it?
>I Just found a VM with 2021.3.1 installed. When I start the docker image here, the generated configuration is different. The compose file is filled:
On your previous screenshot the compose file is also filled in 2022.1 and it is the same in 2022.1 and 2021.3 versions.
definetly not. In 2021.3 the content of "Compose file" is "./src/main/docker/keycloak.yml". In 2022.1 the contenet of "Compose file" is emtpty and the hint "Leave empty to run all services" is displayed. To make it more clear: In the older versions the temporary run configuration created by IntelliJ contains the name of the .yml file that was started via the context menu in the "Compose file" field and in 2022.1 the field is leaved empty.
>In 2021.3 the content of "Compose file" is "./src/main/docker/keycloak.yml".
On your previous screenshot is the the same for 2022.1:
2022.1 version for me:
2021.3 version for me:
Can you attach screenshots of full configuration windows for both versions and the different result that you are getting when running them? Thank you.
Please apologize, i must be blind. I have installed 2021.2.4 and 2021.3.3 from the Jetbrains Toolbox and both show the same behavior (starting all containers). But I definetly had situations where only the keycloak container was started. I think, in this case the other containers where already running.
I am not able to run ANY Django configurations via Docker. This has been happening since 2022.2 !!
This needs to be fixed ASAP, it is a showstopper when trying to do anything other than text-editing. I am forced to use older versions of PyCharm.
Please prioritize and fix this problem!
Could you please try to recreate the Docker interpreter from scratch? Will it help? If not, please submit an issue https://youtrack.jetbrains.com/issues/PY.
You may also try the following workaround :
1. go to Help | Find Action | Registry
2. disable python.use.targets.api
3. recreate the interpreter from scratch