Puppet not showing docker running server












0















I am trying puppet to run a docker container. I am using puppetlabs docker module. Everything is working fine but the run command is not working, despite everything is fine in puppet log and shows running.



==> default: Running Puppet with default.pp...
==> default: Notice: Compiled catalog for pustakalaya.vm.vm.local in environment production in 0.52 seconds
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Exec[install docker]/returns: executed successfully
==> default: Notice: /Stage[main]/Docker::Repos/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]/content: content changed '{md5}c4955fdae0865aac860821ca9257f48b' to '{md5}395ee27d70d138f3f6bdf37acbbb5c4f'
==> default: Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Service[docker]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Run/Docker::Run[nginx]/Service[docker-nginx]/ensure: ensure changed 'stopped' to 'running'


My puppet class is



docker::run { 'nginx':
image => 'nginx:latest',
detach => true,
ports => ['80:80'],
command => "/bin/bash"
}


EDIT solution



According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues










share|improve this question

























  • most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

    – Uku Loskit
    Nov 14 '18 at 12:10











  • @UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

    – Bikram
    Nov 14 '18 at 12:14











  • @Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

    – John Bollinger
    Nov 14 '18 at 15:59
















0















I am trying puppet to run a docker container. I am using puppetlabs docker module. Everything is working fine but the run command is not working, despite everything is fine in puppet log and shows running.



==> default: Running Puppet with default.pp...
==> default: Notice: Compiled catalog for pustakalaya.vm.vm.local in environment production in 0.52 seconds
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Exec[install docker]/returns: executed successfully
==> default: Notice: /Stage[main]/Docker::Repos/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]/content: content changed '{md5}c4955fdae0865aac860821ca9257f48b' to '{md5}395ee27d70d138f3f6bdf37acbbb5c4f'
==> default: Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Service[docker]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Run/Docker::Run[nginx]/Service[docker-nginx]/ensure: ensure changed 'stopped' to 'running'


My puppet class is



docker::run { 'nginx':
image => 'nginx:latest',
detach => true,
ports => ['80:80'],
command => "/bin/bash"
}


EDIT solution



According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues










share|improve this question

























  • most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

    – Uku Loskit
    Nov 14 '18 at 12:10











  • @UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

    – Bikram
    Nov 14 '18 at 12:14











  • @Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

    – John Bollinger
    Nov 14 '18 at 15:59














0












0








0








I am trying puppet to run a docker container. I am using puppetlabs docker module. Everything is working fine but the run command is not working, despite everything is fine in puppet log and shows running.



==> default: Running Puppet with default.pp...
==> default: Notice: Compiled catalog for pustakalaya.vm.vm.local in environment production in 0.52 seconds
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Exec[install docker]/returns: executed successfully
==> default: Notice: /Stage[main]/Docker::Repos/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]/content: content changed '{md5}c4955fdae0865aac860821ca9257f48b' to '{md5}395ee27d70d138f3f6bdf37acbbb5c4f'
==> default: Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Service[docker]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Run/Docker::Run[nginx]/Service[docker-nginx]/ensure: ensure changed 'stopped' to 'running'


My puppet class is



docker::run { 'nginx':
image => 'nginx:latest',
detach => true,
ports => ['80:80'],
command => "/bin/bash"
}


EDIT solution



According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues










share|improve this question
















I am trying puppet to run a docker container. I am using puppetlabs docker module. Everything is working fine but the run command is not working, despite everything is fine in puppet log and shows running.



==> default: Running Puppet with default.pp...
==> default: Notice: Compiled catalog for pustakalaya.vm.vm.local in environment production in 0.52 seconds
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Exec[install docker]/returns: executed successfully
==> default: Notice: /Stage[main]/Docker::Repos/Apt::Source[docker]/Apt::Setting[list-docker]/File[/etc/apt/sources.list.d/docker.list]/content: content changed '{md5}c4955fdae0865aac860821ca9257f48b' to '{md5}395ee27d70d138f3f6bdf37acbbb5c4f'
==> default: Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Installdocker/Service[docker]: Triggered 'refresh' from 1 event
==> default: Notice: /Stage[main]/Pustakalaya::Run/Docker::Run[nginx]/Service[docker-nginx]/ensure: ensure changed 'stopped' to 'running'


My puppet class is



docker::run { 'nginx':
image => 'nginx:latest',
detach => true,
ports => ['80:80'],
command => "/bin/bash"
}


EDIT solution



According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues







docker puppet






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 14:21







Bikram

















asked Nov 14 '18 at 11:14









BikramBikram

114




114













  • most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

    – Uku Loskit
    Nov 14 '18 at 12:10











  • @UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

    – Bikram
    Nov 14 '18 at 12:14











  • @Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

    – John Bollinger
    Nov 14 '18 at 15:59



















  • most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

    – Uku Loskit
    Nov 14 '18 at 12:10











  • @UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

    – Bikram
    Nov 14 '18 at 12:14











  • @Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

    – John Bollinger
    Nov 14 '18 at 15:59

















most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

– Uku Loskit
Nov 14 '18 at 12:10





most likely you already have something listening on port 80 and this made the container die: docker ps -a on the host and see if the container did indeed exit

– Uku Loskit
Nov 14 '18 at 12:10













@UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

– Bikram
Nov 14 '18 at 12:14





@UkuLoskit No, there is no any in docker ps -a. Also, port 80 is not used. when I try docker command it works

– Bikram
Nov 14 '18 at 12:14













@Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

– John Bollinger
Nov 14 '18 at 15:59





@Bikram, if you have found a solution yourself and would like to share it (thanks!) then the customary way to do so around here is to write and post an actual answer to the question. Editing the solution into the question is inconsistent with our model and conventions.

– John Bollinger
Nov 14 '18 at 15:59












1 Answer
1






active

oldest

votes


















0














The container lives for as long as the command you're running.



In your case it most likely runs a non-interactive call to bash successfully and exits with 0.



To keep the container running you'd want to pass the --interactive param to docker. Looking at the puppet docker docs it sounds like you can add extra_parameters => ['--interactive'], to your docker::run.






share|improve this answer
























  • I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

    – Bikram
    Nov 14 '18 at 12:53













  • According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

    – Bikram
    Nov 14 '18 at 13:01











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298920%2fpuppet-not-showing-docker-running-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The container lives for as long as the command you're running.



In your case it most likely runs a non-interactive call to bash successfully and exits with 0.



To keep the container running you'd want to pass the --interactive param to docker. Looking at the puppet docker docs it sounds like you can add extra_parameters => ['--interactive'], to your docker::run.






share|improve this answer
























  • I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

    – Bikram
    Nov 14 '18 at 12:53













  • According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

    – Bikram
    Nov 14 '18 at 13:01
















0














The container lives for as long as the command you're running.



In your case it most likely runs a non-interactive call to bash successfully and exits with 0.



To keep the container running you'd want to pass the --interactive param to docker. Looking at the puppet docker docs it sounds like you can add extra_parameters => ['--interactive'], to your docker::run.






share|improve this answer
























  • I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

    – Bikram
    Nov 14 '18 at 12:53













  • According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

    – Bikram
    Nov 14 '18 at 13:01














0












0








0







The container lives for as long as the command you're running.



In your case it most likely runs a non-interactive call to bash successfully and exits with 0.



To keep the container running you'd want to pass the --interactive param to docker. Looking at the puppet docker docs it sounds like you can add extra_parameters => ['--interactive'], to your docker::run.






share|improve this answer













The container lives for as long as the command you're running.



In your case it most likely runs a non-interactive call to bash successfully and exits with 0.



To keep the container running you'd want to pass the --interactive param to docker. Looking at the puppet docker docs it sounds like you can add extra_parameters => ['--interactive'], to your docker::run.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 14 '18 at 12:33









Stefan RStefan R

27115




27115













  • I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

    – Bikram
    Nov 14 '18 at 12:53













  • According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

    – Bikram
    Nov 14 '18 at 13:01



















  • I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

    – Bikram
    Nov 14 '18 at 12:53













  • According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

    – Bikram
    Nov 14 '18 at 13:01

















I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

– Bikram
Nov 14 '18 at 12:53







I removed detach => true and it worked. I don't understand the issue here. But anyway thanks

– Bikram
Nov 14 '18 at 12:53















According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

– Bikram
Nov 14 '18 at 13:01





According to github.com/puppetlabs/puppetlabs-docker/issues/313 On an os using systemd you don't need the detatch => true param set. If you remove it the example you've provide will run without any issues.

– Bikram
Nov 14 '18 at 13:01


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • 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%2fstackoverflow.com%2fquestions%2f53298920%2fpuppet-not-showing-docker-running-server%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

List item for chat from Array inside array React Native

Thiostrepton

Caerphilly