For example, if we ran npm start func start basically three are two things happening,
It will create a container from a given image for example its cloudlibz/clocal-gcp-function:latest
Next it will run the specified bash script inside the container.
But If there is an error running the commands inside the container, the program will show an error and stop.
But the container didn't stop or removed, it still running with the given port. ( docker ps )
Next, if the user solves the problem when running the bash commands, but there will be another problem if he tries to run the npm start func start again because the old container is still running on the same port as the new container.
Also after running 'npm start func start' for the 2nd time the container will also create and it's not running. ( docker ps -a). that mean program will show an error after creating the container and won't run the scripts inside the container.
To stop this user will have to remove the container manually.
To solve this issue (both issues) I removed the container if there is an error running the commands inside the container or if there is an error after the container created in every cloud service.
For example, if we ran
npm start func start
basically three are two things happening,docker ps
)npm start func start
again because the old container is still running on the same port as the new container.Also after running 'npm start func start' for the 2nd time the container will also create and it's not running. (
docker ps -a
). that mean program will show an error after creating the container and won't run the scripts inside the container.To stop this user will have to remove the container manually.![image](https://user-images.githubusercontent.com/40508640/111674288-dd2e8f80-8841-11eb-83df-d48c8dc204a0.png)
To solve this issue (both issues) I removed the container if there is an error running the commands inside the container or if there is an error after the container created in every cloud service.
Issue was addressed with PR #103