Unable to use Systemd to start my Docker containerUnison and systemd timer problem$XAUTHORITY in systemdRun sudo script at startup under 15.04 using 'systemd'Docker fails to start if configured to use devicemapper with direct-lvmHow to convert this custom upstart job to systemd?Systemd doesn't restart monit after killUnable to install docker - invoke-rc.d: initscript docker, action “start” failedWhy does systemd stop my service but not restart it?Systemd runs start and stop commands simultaneously on Ubuntu 18.04 - Minecraft server issuesubuntu snmpd ignores /etc/default/snmpd

How can a jailer prevent the Forge Cleric's Artisan's Blessing from being used?

I2C signal and power over long range (10meter cable)

Stereotypical names

How can I successfully establish a nationwide combat training program for a large country?

What (else) happened July 1st 1858 in London?

The One-Electron Universe postulate is true - what simple change can I make to change the whole universe?

Does "Dominei" mean something?

What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?

Simple recursive Sudoku solver

Have I saved too much for retirement so far?

For airliners, what prevents wing strikes on landing in bad weather?

Why does this part of the Space Shuttle launch pad seem to be floating in air?

What does the "3am" section means in manpages?

Should my PhD thesis be submitted under my legal name?

Visiting the UK as unmarried couple

"lassen" in meaning "sich fassen"

Female=gender counterpart?

Proof of Lemma: Every integer can be written as a product of primes

Is a naturally all "male" species possible?

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

Can a Bard use an arcane focus?

What to do when my ideas aren't chosen, when I strongly disagree with the chosen solution?

Bob has never been a M before



Unable to use Systemd to start my Docker container


Unison and systemd timer problem$XAUTHORITY in systemdRun sudo script at startup under 15.04 using 'systemd'Docker fails to start if configured to use devicemapper with direct-lvmHow to convert this custom upstart job to systemd?Systemd doesn't restart monit after killUnable to install docker - invoke-rc.d: initscript docker, action “start” failedWhy does systemd stop my service but not restart it?Systemd runs start and stop commands simultaneously on Ubuntu 18.04 - Minecraft server issuesubuntu snmpd ignores /etc/default/snmpd













0















I have a very specific issue with running a Docker container on boot using systemd.



The container starts and stops successfully with the following scripts:



start-container.sh



#!/usr/bin/env bash
sleep 5
docker start container_name


stop-container.sh



#!/usr/bin/env bash
sleep 5
docker stop container_name


However, when I configure the following service using systemd, it does not run successfully:



[Unit]
Description=Docker Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target
After=multi-user.target

[Service]
User=root
Type=simple
ExecStart=/home/seed/scripts/start-container.sh
ExecStop=/home/seed/scripts/stop-container.sh
TimeoutSec=60
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=default.target









share|improve this question







New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

    – feral_fenrir
    13 mins ago















0















I have a very specific issue with running a Docker container on boot using systemd.



The container starts and stops successfully with the following scripts:



start-container.sh



#!/usr/bin/env bash
sleep 5
docker start container_name


stop-container.sh



#!/usr/bin/env bash
sleep 5
docker stop container_name


However, when I configure the following service using systemd, it does not run successfully:



[Unit]
Description=Docker Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target
After=multi-user.target

[Service]
User=root
Type=simple
ExecStart=/home/seed/scripts/start-container.sh
ExecStop=/home/seed/scripts/stop-container.sh
TimeoutSec=60
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=default.target









share|improve this question







New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

    – feral_fenrir
    13 mins ago













0












0








0








I have a very specific issue with running a Docker container on boot using systemd.



The container starts and stops successfully with the following scripts:



start-container.sh



#!/usr/bin/env bash
sleep 5
docker start container_name


stop-container.sh



#!/usr/bin/env bash
sleep 5
docker stop container_name


However, when I configure the following service using systemd, it does not run successfully:



[Unit]
Description=Docker Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target
After=multi-user.target

[Service]
User=root
Type=simple
ExecStart=/home/seed/scripts/start-container.sh
ExecStop=/home/seed/scripts/stop-container.sh
TimeoutSec=60
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=default.target









share|improve this question







New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have a very specific issue with running a Docker container on boot using systemd.



The container starts and stops successfully with the following scripts:



start-container.sh



#!/usr/bin/env bash
sleep 5
docker start container_name


stop-container.sh



#!/usr/bin/env bash
sleep 5
docker stop container_name


However, when I configure the following service using systemd, it does not run successfully:



[Unit]
Description=Docker Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target
After=multi-user.target

[Service]
User=root
Type=simple
ExecStart=/home/seed/scripts/start-container.sh
ExecStop=/home/seed/scripts/stop-container.sh
TimeoutSec=60
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=default.target






command-line server scripts systemd docker






share|improve this question







New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 34 mins ago









feral_fenrirferal_fenrir

1011




1011




New contributor




feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






feral_fenrir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

    – feral_fenrir
    13 mins ago

















  • Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

    – feral_fenrir
    13 mins ago
















Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

– feral_fenrir
13 mins ago





Update: I followed this mehmandarov.com/start-docker-containers-automatically too and updated the service file to require and run after docker.service. But this does not work either!

– feral_fenrir
13 mins ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






feral_fenrir is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128709%2funable-to-use-systemd-to-start-my-docker-container%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








feral_fenrir is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















feral_fenrir is a new contributor. Be nice, and check out our Code of Conduct.












feral_fenrir is a new contributor. Be nice, and check out our Code of Conduct.











feral_fenrir is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128709%2funable-to-use-systemd-to-start-my-docker-container%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org