Puppet not showing docker running server
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
add a comment |
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
most likely you already have something listening on port 80 and this made the container die:docker ps -aon 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
add a comment |
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
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
docker puppet
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 -aon 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
add a comment |
most likely you already have something listening on port 80 and this made the container die:docker ps -aon 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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
});
}
});
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%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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
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%2fstackoverflow.com%2fquestions%2f53298920%2fpuppet-not-showing-docker-running-server%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
most likely you already have something listening on port 80 and this made the container die:
docker ps -aon 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