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

Is compression “encryption” under FCC regs?Signing of messages transmitted over ham radioWhy do Amateur Radio organizations in the United States oppose the relaxation of encryption prohibitions?How far from earth do FCC regulations apply?How can I know whether a radio is FCC approved?FCC tracking of unlicensed FRS/GMRS transmissionsWhy does the FCC put restrictions on symbol rates?legal - Do FCC regulations only apply in U.S.A?What are FCC/Industry Canada certification requirements for amateur radio related products?How to get professional or official clarification of FCC Part 97 rules for specific complicated situations?Is there any point to keep the CSCE after the FCC registers the upgrade?Do FCC regulations limit digital data rate?

macOS: Name for app shortcut screen found by pinching with thumb and three fingers Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30UTC (7:30pm US/Eastern) Should an RSS feed of hot network questions feed any chat room(s) here?How do I get three finger gestures working again in Twitter for Mac after installing Lion?After my MacBook Pro sleeps some gestures don't work anymoreIs it possible to reassign the “Pinch with thumb and three fingers” gesture to activate Dashboard instead of Launchpad?Disable animation for “Swipe between full-screen apps”?OSX Yosemite Can't disable four-finger swipeDrag with three fingers missing in OS X 10.11 Beta “El Capitan” (15A215h)A shortcut for Merge all Windows on macOS SierraSet the hostname/computer name for macOSmacOS: Identify tool and keyboard shortcutQuickly save Screenshot in MacOS Mojave with keyboard Shortcut

What's wrong with this bogus proof?What's wrong with this random variable proof?What's wrong with this proof that all UFDs are Bezout?What's wrong with this proof by contradiction?A bogus proof of countable power setWhat's wrong with this proof $1=i^2=-1$What is wrong with this proofWhat's wrong with this proof of symmetry of equality?What's wrong with this 1 = -1 proof?What's wrong with this proof? (Regular languages)What's wrong in this proof of 1=2?