Run commands using docker container

Answered

I'm currently working on a plugin for PhpStorm. It adds a section to the project generation wizard using directoryProjectGenerator extension point. from there I want to execute some commands inside a Docker container to create a new project following these steps:

  1. pulling an image if not exists,
  2. run some command using that image
  3. attach a progress indicator to the running process inside container

I already added Docker plugin as a dependency, but I'm not sure which classes should I use.

What is the proper way to do that?

Thanks in advance.

0
1 comment

Hi, you can use RemoteDockerRuntimesManager to get an instance of DockerAgent and then create a container using DockerAgentDeployment. Alternatively, you can use DockerServerRuntimesManager for a higher-level API with communication with the plugin tree.

0

Please sign in to leave a comment.