Rebuild and ReRun a DockerContainer
<p>I'm experimenting with Docker, and I set up a Node App.
The App is in a GIT Repo in my Gogs Container.</p>

<p>I want to keep all the code inside my container, so at the app root I have my Dockerfile.</p>

<p>I want to create a Shell script to automatically ReBuild my Container and ReRun it.
This script is calling later through a "webhook-container" during a GIT push.</p>

<p>The Docker CLI has only a build and a run command. But both fails if a image or a container with the name already exists.</p>

<p>What is the best practice to handle this?</p>

<p>Remark: I don't want to keep my app sources on the host and update only the source and restart the container! 
I like the idea that my entire app is a container.</p>