Error with docker run -d --restart=always --name="mailserver" --memory-swappiness 0 analogic/poste.io

Hi,

I am new to docker and only just ran a container. All went well.

I stoped the container, but would like to run this with some auto start options. The instance is called mailserver as shown below.

$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a04c8a01d2e4 analogic/poste.io "/init --memory-swapp" 10 minutes ago Exited (0) 10 minutes ago boring_newton 6d9f16215e62 analogic/poste.io "/init" 12 minutes ago Exited (0) 10 minutes ago grave_noether 8eb84e0417c5 0f7a3bfda608 "/bin/sh -c 'apt-get " 52 minutes ago Exited (0) 52 minutes ago elated_pasteur 3a929be0b4cc analogic/poste.io "/init" 2 hours ago Exited (0) 10 minutes ago mailserver

I tried this but cannot get it to start the same instance. I am worried I will be unable to start my container again and potentially lose my work.

$ docker run -d --restart=always --name="mailserver" --memory-swappiness 0 analogic/poste.io docker: Error response from daemon: Conflict. The name "/mailserver" is already in use by container 3a929be0b4ccea5b0aecd82877eac57a7ef4c9c8985f673483e1d1b46e09501b. You have to remove (or rename) that container to be able to reuse that name..
If I delete the container with the name mailserver I will lose all my work. I just want to start container “mailserver” and have it auto start when it crashes. If this is possible I’d be really happy because I spent hours configuring this container.

Kind regards, So.