Docker CE not registered as a service on Debian 9











up vote
0
down vote

favorite












I've installed the Docker Community Edition according to the resource: https://linuxize.com/post/how-to-install-and-use-docker-on-debian-9/



However, when I reach step 5 (systemctl status docker) I get the following error message instead of the service status:



root@srv-012:/etc/systemd# systemctl start docker
Failed to start docker.service: Unknown unit: docker.service
See system logs and 'systemctl status docker.service' for details.


All commands are run as root. How can I fix this?



EDIT:



The file `/lib/systemd/system/docker.service` is created correctly, here is the contents:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target









share|improve this question









New contributor




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




















  • Try to Fix your Typos
    – 神秘德里克
    2 hours ago










  • Which typos are you referring to?
    – Daniel Becker
    2 hours ago















up vote
0
down vote

favorite












I've installed the Docker Community Edition according to the resource: https://linuxize.com/post/how-to-install-and-use-docker-on-debian-9/



However, when I reach step 5 (systemctl status docker) I get the following error message instead of the service status:



root@srv-012:/etc/systemd# systemctl start docker
Failed to start docker.service: Unknown unit: docker.service
See system logs and 'systemctl status docker.service' for details.


All commands are run as root. How can I fix this?



EDIT:



The file `/lib/systemd/system/docker.service` is created correctly, here is the contents:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target









share|improve this question









New contributor




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




















  • Try to Fix your Typos
    – 神秘德里克
    2 hours ago










  • Which typos are you referring to?
    – Daniel Becker
    2 hours ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've installed the Docker Community Edition according to the resource: https://linuxize.com/post/how-to-install-and-use-docker-on-debian-9/



However, when I reach step 5 (systemctl status docker) I get the following error message instead of the service status:



root@srv-012:/etc/systemd# systemctl start docker
Failed to start docker.service: Unknown unit: docker.service
See system logs and 'systemctl status docker.service' for details.


All commands are run as root. How can I fix this?



EDIT:



The file `/lib/systemd/system/docker.service` is created correctly, here is the contents:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target









share|improve this question









New contributor




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











I've installed the Docker Community Edition according to the resource: https://linuxize.com/post/how-to-install-and-use-docker-on-debian-9/



However, when I reach step 5 (systemctl status docker) I get the following error message instead of the service status:



root@srv-012:/etc/systemd# systemctl start docker
Failed to start docker.service: Unknown unit: docker.service
See system logs and 'systemctl status docker.service' for details.


All commands are run as root. How can I fix this?



EDIT:



The file `/lib/systemd/system/docker.service` is created correctly, here is the contents:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target






debian docker






share|improve this question









New contributor




Daniel Becker 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




Daniel Becker 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








edited 1 hour ago





















New contributor




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









asked 2 hours ago









Daniel Becker

11




11




New contributor




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





New contributor





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






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












  • Try to Fix your Typos
    – 神秘德里克
    2 hours ago










  • Which typos are you referring to?
    – Daniel Becker
    2 hours ago


















  • Try to Fix your Typos
    – 神秘德里克
    2 hours ago










  • Which typos are you referring to?
    – Daniel Becker
    2 hours ago
















Try to Fix your Typos
– 神秘德里克
2 hours ago




Try to Fix your Typos
– 神秘德里克
2 hours ago












Which typos are you referring to?
– Daniel Becker
2 hours ago




Which typos are you referring to?
– Daniel Becker
2 hours ago










2 Answers
2






active

oldest

votes

















up vote
0
down vote













First, verify that file /lib/systemd/system/docker.service actually exists; if it doesn't, a previous installation step has failed - or the name of the service has changed since the tutorial was written.



Then, run systemctl daemon-reload to make systemd reload any new unit files. If systemctl status docker works after this, you might file a bug report about bad .deb packaging - the package should have done that automatically on install.






share|improve this answer





















  • Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
    – Daniel Becker
    2 hours ago












  • Next thing to check would be the contents of the docker.service file.
    – telcoM
    2 hours ago












  • Thanks, I added the content of the file, which looks good to me.
    – Daniel Becker
    1 hour ago










  • That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
    – telcoM
    31 mins ago


















up vote
0
down vote













Alternative solution.



When I installed docker on debian, I uses apt. I first had to add the repository to the sources. But after that I just did an apt-get update and an apt-get install. This is much easier.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    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',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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
    });


    }
    });






    Daniel Becker 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%2funix.stackexchange.com%2fquestions%2f481644%2fdocker-ce-not-registered-as-a-service-on-debian-9%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    First, verify that file /lib/systemd/system/docker.service actually exists; if it doesn't, a previous installation step has failed - or the name of the service has changed since the tutorial was written.



    Then, run systemctl daemon-reload to make systemd reload any new unit files. If systemctl status docker works after this, you might file a bug report about bad .deb packaging - the package should have done that automatically on install.






    share|improve this answer





















    • Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
      – Daniel Becker
      2 hours ago












    • Next thing to check would be the contents of the docker.service file.
      – telcoM
      2 hours ago












    • Thanks, I added the content of the file, which looks good to me.
      – Daniel Becker
      1 hour ago










    • That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
      – telcoM
      31 mins ago















    up vote
    0
    down vote













    First, verify that file /lib/systemd/system/docker.service actually exists; if it doesn't, a previous installation step has failed - or the name of the service has changed since the tutorial was written.



    Then, run systemctl daemon-reload to make systemd reload any new unit files. If systemctl status docker works after this, you might file a bug report about bad .deb packaging - the package should have done that automatically on install.






    share|improve this answer





















    • Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
      – Daniel Becker
      2 hours ago












    • Next thing to check would be the contents of the docker.service file.
      – telcoM
      2 hours ago












    • Thanks, I added the content of the file, which looks good to me.
      – Daniel Becker
      1 hour ago










    • That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
      – telcoM
      31 mins ago













    up vote
    0
    down vote










    up vote
    0
    down vote









    First, verify that file /lib/systemd/system/docker.service actually exists; if it doesn't, a previous installation step has failed - or the name of the service has changed since the tutorial was written.



    Then, run systemctl daemon-reload to make systemd reload any new unit files. If systemctl status docker works after this, you might file a bug report about bad .deb packaging - the package should have done that automatically on install.






    share|improve this answer












    First, verify that file /lib/systemd/system/docker.service actually exists; if it doesn't, a previous installation step has failed - or the name of the service has changed since the tutorial was written.



    Then, run systemctl daemon-reload to make systemd reload any new unit files. If systemctl status docker works after this, you might file a bug report about bad .deb packaging - the package should have done that automatically on install.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 hours ago









    telcoM

    14k11842




    14k11842












    • Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
      – Daniel Becker
      2 hours ago












    • Next thing to check would be the contents of the docker.service file.
      – telcoM
      2 hours ago












    • Thanks, I added the content of the file, which looks good to me.
      – Daniel Becker
      1 hour ago










    • That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
      – telcoM
      31 mins ago


















    • Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
      – Daniel Becker
      2 hours ago












    • Next thing to check would be the contents of the docker.service file.
      – telcoM
      2 hours ago












    • Thanks, I added the content of the file, which looks good to me.
      – Daniel Becker
      1 hour ago










    • That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
      – telcoM
      31 mins ago
















    Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
    – Daniel Becker
    2 hours ago






    Thanks, the file does exist and systemctl daemon-reload runs successfully. However, systemctl status docker is still failing with this error: Failed to get properties: No such interface ''
    – Daniel Becker
    2 hours ago














    Next thing to check would be the contents of the docker.service file.
    – telcoM
    2 hours ago






    Next thing to check would be the contents of the docker.service file.
    – telcoM
    2 hours ago














    Thanks, I added the content of the file, which looks good to me.
    – Daniel Becker
    1 hour ago




    Thanks, I added the content of the file, which looks good to me.
    – Daniel Becker
    1 hour ago












    That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
    – telcoM
    31 mins ago




    That error message suggests some kind of problem in communication between the systemctl command and the systemd daemon. Does systemctl status in general work at all? Are you using some other init system instead of Debian 9 default systemd? That Docker package you installed assumes systemd is used. Is the systemd-sysv package installed?
    – telcoM
    31 mins ago












    up vote
    0
    down vote













    Alternative solution.



    When I installed docker on debian, I uses apt. I first had to add the repository to the sources. But after that I just did an apt-get update and an apt-get install. This is much easier.






    share|improve this answer

























      up vote
      0
      down vote













      Alternative solution.



      When I installed docker on debian, I uses apt. I first had to add the repository to the sources. But after that I just did an apt-get update and an apt-get install. This is much easier.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Alternative solution.



        When I installed docker on debian, I uses apt. I first had to add the repository to the sources. But after that I just did an apt-get update and an apt-get install. This is much easier.






        share|improve this answer












        Alternative solution.



        When I installed docker on debian, I uses apt. I first had to add the repository to the sources. But after that I just did an apt-get update and an apt-get install. This is much easier.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 40 mins ago









        ctrl-alt-delor

        9,73031952




        9,73031952






















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










             

            draft saved


            draft discarded


















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













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












            Daniel Becker 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%2funix.stackexchange.com%2fquestions%2f481644%2fdocker-ce-not-registered-as-a-service-on-debian-9%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            Popular posts from this blog

            List directoties down one level, excluding some named directories and files

            list processes belonging to a network namespace

            List all connected SSH sessions?