Building on Ubuntu 21.10 failing to install postfix#2468
Conversation
|
Documentation preview for this PR is ready! 🎉 Built with commit: 8d16056 |
|
Original issue: #2023 |
0253ee1 to
9f2c38e
Compare
polarathene
left a comment
There was a problem hiding this comment.
Please update the issue reference to a relevant comment and use a reserved TLD (.invalid) instead of an unregistered one.
429914b to
d3ec842
Compare
|
To the team: Do we really want to have a workaround like this? I prefer ubuntu server, but I could switch to Debian I guess... |
|
FWIW, it appears there's another option available now. If using BuildKit with an ENV to provide a temporary hostname to the image builder.. however comments near the end also mention it being less straight-forward to use than |
It's a VM right? The docker host side change is fairly simple to add and for a throwaway VM not really an issue. I don't think the workaround this PR uses is going to cause any issues, so long as something else isn't trying to use Debian will presumably run into the same problem by it's next release, or they fix their postfix package. I wouldn't mind us using a newer version of Postfix either though instead of the package if someone wants to add that (good if we adopt a multi-stage build?). |
Yep, I tried it. It doesn't work. Postfix still uses |
gasp, what did you call my special VM!? ;) I plan on keeping this VM around for any future changes I make but that's a fair point. |
You mentioned in an other issue, that you mount DMS to your VM (which introduce permission problems). You could place DMS directly inside your VM. In case you are using VS Code, take a look at remote-ssh. With that, you can easily work with the files inside your VM. |
For me it's a bit like the MacOS specific hacks. We have a supported base, in this case Debian. If it also works on other OS's fine, but I am unsure if we should take care for it (introducing workarounds). |
| apt-get -qq dist-upgrade && \ | ||
| echo "applying workaround for ubuntu/postfix bug described in https://github.com/docker-mailserver/docker-mailserver/issues/2023#issuecomment-855326403" && \ | ||
| mv /bin/hostname{,.bak} && \ | ||
| echo "echo docker-mailserver.invalid" > /bin/hostname && \ |
There was a problem hiding this comment.
Have you tested this? I don't think this will work without a shebang line.
| echo "echo docker-mailserver.invalid" > /bin/hostname && \ | |
| echo -e "#!/bin/bash\necho docker-mailserver.invalid" > /bin/hostname && \ |
I'm happy to just go with my original proposal of documenting it. I imagine most aren't regularly building the Docker image, and if they need to they could make the host side workaround I've detailed, or build the image within a Debian guest VM (Ubuntu 20.04 should work too AFAIK since that's what our CI is using, but newer versions of Ubuntu won't). The next Debian release isn't due until sometime in 2023 apparently, so it may be a while before it affects Debian and they fix the package patches on their end. The workaround in this PR isn't much to worry about either though AFAIK. We have other options too but those require more effort on our end (such as building Postfix ourselves). |
You would only have problems if you did not have that |
I see. I think there are actually many contributors to this project that use Ubuntu. Therefore, I'd (although this being hacky) vote for merging this. We should also document it and add a note about reverting this PR once there are upstream changes that fix this... |
|
Host issues should be fixed on the host IMO and we should keep our code base free of workarounds. Therefore I vote against this addition. But feel free to outvote me - it's fine 😄 |
It's actually an issue with the Debian Postfix package post-install step making assumptions. If we compiled Postfix ourselves instead of using the package, or patched the package before installing it, we wouldn't have the issue either. The only reason I am in more support of a workaround in the Dockerfile is because that's more of a viable solution than requiring affected users to modify their DNS resolution on host. It's probably unlikely when working with Docker, but in some environments the user may have the ability to run |
|
Convinced 👍 PS: So if I understand correctly, we would have the some problem, when our CI upgrades to a newer Ubuntu version, right? |
Possibly, it would depend if Github CI instances have the local DNS resolver ( |
|
@georglauterbach do I need to change the base branch since this is slotted for 11.0? I'm moving over the next week so my replies will be delayed. Feel free to merge it once approved! |
|
Can anyone explain, why adding |
|
@NorseGaud feel free to just merge this into `master´ once approved :) |
|
@casperklein does this article help? I guess |
|
I saw this too, but I found nothing about best-practicing, adding |
A single DNS label is not valid for DNS query, only mDNS. Oh you were specifically asking about My linked issue about it references the associated systemd update changelog which describes why they add
|
|
Now I see the error on one of my devices as well, pretty annoying... |
|
I thought, systemd would just add the search option to But even if you use a custom systemd: Just mapping |
|
It seems, if the shebang line in a script is missing, there is a fallback to the system's default shell. Not a clean solution IMO, but seems to work. |
If you want that, you can do so with host mode networking. systemd should not be doing anything to the containers config from the host, that's probably Docker meddling with it. |
|
Sorry for asking again. But you said, that the addition of Let me summarize it:
I just try to finally understand, who's the bad guy and does weird things. From the table above it looks like, it's systemd? |
I said systemd only modifies the host system config, it will not interfere with the containers directly. The container may "import" the host config, especially with host mode networking, otherwise Docker daemon is doing it's own modification separately (like it does with setting hostname to the container name/id). The newer version of systemd as per the changelog adds With your custom change on host, did you just modify the file, or configure it so systemd was re-generating If you use host networking, perhaps it will use the modified one on your host, I just recall systemd adding a comment about If you apply a change to search domain like that, it probably carries of into the guest container. Perhaps there's a way to prevent injecting the |
|
I didn't use host networking, just the default network mode docker provides.
I've already killed the test VM, so I cannot take a detailed look. But Maybe Docker don't cares for Enough time invested 😆 Thanks for your help. |
Recently looked into this and verified it works:
|
Description
Fixes #2467
This is a workaround until postfix gets this bug fixed.
Type of change
Checklist:
docs/)