Script i use for creating dockers on unix systems

I have create a script for personal use to easily create dockers with changing just a few parameters within the script.
Since i’m no Unix guru, this might be open for improvements.

I would call my 1st script, for example. It uses a own created bridge network so i can assign ip adressess.

If this needs an update, i would just run the script since data is persistent and it deletes and retrevies the image.

#!/usr/bin/env bash

docker stop $dockername
docker rm $dockername
docker rmi $dockerimage
docker create \
--name=$dockername \
--hostname=$dockername \
--net=$dockernetwork \
--ip= \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/dockers/$dockername:/data \
docker update --restart=always $dockername
docker start $dockername