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:
- pulling an image if not exists,
- run some command using that image
- 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.
Please sign in to leave a comment.
Hi, you can use
RemoteDockerRuntimesManagerto get an instance ofDockerAgentand then create a container usingDockerAgentDeployment. Alternatively, you can useDockerServerRuntimesManagerfor a higher-level API with communication with the plugin tree.