--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/fe9fe6d9-0c25-49ae-8b5d-aec868495b36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Daniel,
We want to use our Java docker image (tagged as idealista/8u181-stretch-openjdk-headless in Docker Hub) which is based in Debian Stretch Slim.
This image doesn't have systemd (neither official image, nor our derived image one), so this package should be installed to be used later to configure our services. AFAIK, if you want to use systemd to manage services, this process should be the first -> should be present in Docker run command. But the problem is, before installation /lib/system/systemd is not present, so the container cannot start. This could be solved using RUN when you are using Dockerfiles, because that commands are executed in the image "build phase". You can install systemd before and execute /lib/system/systemd at container startup.
As Rickard said, you can use a shell provisioner to run any command you want (in this case the one to start systemd) once your container is up with Packer. Another solution is to override the RUN command (as per https://www.packer.io/docs/builders/docker.html#run_command) to specify what you want.
So in short I'd advise:
AFAIK, systemd must be running when you use commands like
'service' but it does not need to be started when the container
starts (there are ways to do that if needed).
On a related note, I had a similar issue with the container not
starting, because the default Packer 'docker run' command relies
on /bin/bash + not having an entrypoint set (cf https://github.com/hashicorp/packer/issues/6920).
The changes was made but later reverted because of backward
compatibility issues. You might find the issue useful in your case
tool.
Let us know how it goes,
Vincent
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/72c11e2b-38c1-2890-8ba0-ae3da7012f40%40datameer.com.
Hi Rickard,
I think there is som confusion of what RUN in a Dockerfile does. It executes the command during the build of the image. That would be handled by a shell provisioner in Packer.
What process gets started when you run the container from the resulting image is handled by ENTRYPOINT and CMD those can be set in packer with the changes 1).
So to produce a image that runs systemd do:
a) shell provisioner to install systemd and servicesb) change the ENTRYPOINT/CMD in changes to run systemd.
Thanks for the clarification between
running a container and building it, this was needed indeed (I
realized my explanation might not have been clear enough on this
front).
Vincent
I think there is som confusion of what RUN in a Dockerfile does
So to produce a image that runs systemd do:a) shell provisioner to install systemd and servicesb) change the ENTRYPOINT/CMD in changes to run systemd.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/0995fd92-484f-4b8d-9685-3dff1e4aae3d%40googlegroups.com.
Hi Daniel,
I think there is som confusion of what RUN in a Dockerfile does
I don't agree, my problem it's about something that is called "docker builder" in Packer cannot be used to build anything (as I cannot execute any "RUN" command). Maybe it's a semantic question.
So to produce a image that runs systemd do:
a) shell provisioner to install systemd and servicesb) change the ENTRYPOINT/CMD in changes to run systemd.
It's clear to me that using some provisioners you can do a workaround for other cases, but I think that is not for systemd. AFAIK, systemd should be the first daemon to start and the last daemon to stop.
Do you have any evidence to support that claim? The 'first thing to start and last to stop' is from a runtime point of view when the container is running. When building, I think (but I have not tried) that what only matters is that you have systemd running.
As Rickard said, let's see with your sample Dockerfile what you
want to do.
Vincent
Hi Daniel,
Any followups on this issue?
Thanks for the heads-up,
Vincent
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt_NvJEt%3DQFkejfx7NqcdAbMMLxiKK3d4JZ0Z%2Bu0y-di7Q%40mail.gmail.com.