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
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
New contributor
add a comment |
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
New contributor
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
add a comment |
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
New contributor
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
command-line server scripts systemd docker
New contributor
New contributor
New contributor
asked 34 mins ago
feral_fenrirferal_fenrir
1011
1011
New contributor
New contributor
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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