Gitlab Docker Postfix start on “boot”
I have set up GitLab on docker container (from gitlab/gitlab-ce).
did apt-get install postfix
inside container.
Now when I restart container, postfix is not started (through in /etc/rc2.d/
there is S01postfix link).
Question: how do I start services in container (like postfix) when docker container (re)starts
?
docker gitlab containers postfix-mta
add a comment |
I have set up GitLab on docker container (from gitlab/gitlab-ce).
did apt-get install postfix
inside container.
Now when I restart container, postfix is not started (through in /etc/rc2.d/
there is S01postfix link).
Question: how do I start services in container (like postfix) when docker container (re)starts
?
docker gitlab containers postfix-mta
1
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25
add a comment |
I have set up GitLab on docker container (from gitlab/gitlab-ce).
did apt-get install postfix
inside container.
Now when I restart container, postfix is not started (through in /etc/rc2.d/
there is S01postfix link).
Question: how do I start services in container (like postfix) when docker container (re)starts
?
docker gitlab containers postfix-mta
I have set up GitLab on docker container (from gitlab/gitlab-ce).
did apt-get install postfix
inside container.
Now when I restart container, postfix is not started (through in /etc/rc2.d/
there is S01postfix link).
Question: how do I start services in container (like postfix) when docker container (re)starts
?
docker gitlab containers postfix-mta
docker gitlab containers postfix-mta
edited Nov 14 '18 at 15:36
OscarAkaElvis
2,38511230
2,38511230
asked Nov 14 '18 at 15:17
dockter cdockter c
61
61
1
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25
add a comment |
1
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25
1
1
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25
add a comment |
1 Answer
1
active
oldest
votes
You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.
But as somebody said in comments, this is a dirty solution. It should be separated containers.
Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/
Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
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%2f53303410%2fgitlab-docker-postfix-start-on-boot%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
You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.
But as somebody said in comments, this is a dirty solution. It should be separated containers.
Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/
Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
add a comment |
You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.
But as somebody said in comments, this is a dirty solution. It should be separated containers.
Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/
Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
add a comment |
You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.
But as somebody said in comments, this is a dirty solution. It should be separated containers.
Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/
Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.
You should re-build the container. Do you have the Dockerfile? if yes, you can modify it not only to add your service, you'll need to set an ENTRYPOINT to launch postfix while CMD passed as argument will launch gitlab.
But as somebody said in comments, this is a dirty solution. It should be separated containers.
Another "dirty" solution could be this: https://docs.docker.com/config/containers/multi-service_container/
Using the stuff of this last link (supervisord) you can use a wrapper to launch two ore more services inside the same container.
edited Nov 14 '18 at 15:46
answered Nov 14 '18 at 15:36
OscarAkaElvisOscarAkaElvis
2,38511230
2,38511230
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
add a comment |
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
If you specify an ENTRYPOINT, only that gets run, and it gets passed the CMD as arguments. You can’t use separate ENTRYPOINT and CMD to start two things in one container (without doing the heavy lifting in the ENTRYPOINT).
– David Maze
Nov 14 '18 at 15:43
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
It can be done. It's a bad practice but it can be done. You can start some stuff on ENTRYPOINT and then run the CMD. Try it you can set ENTRYPOINT and then pass arguments as you said to run CMD stuff.
– OscarAkaElvis
Nov 14 '18 at 15:44
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
I found another "dirty" solution, I'll edit my answer.
– OscarAkaElvis
Nov 14 '18 at 15:47
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%2f53303410%2fgitlab-docker-postfix-start-on-boot%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
1
Generally you run them in separate containers; multiple services in a single container isn’t usually a best practice. That’s doubly true when the other service is something like an SMTP relay with a well-defined network interface.
– David Maze
Nov 14 '18 at 15:25