Fork me on GitHub
#babashka
<
2023-11-03
>
Daniel Jomphe13:11:50

Hi! My question is a bit out of topic for any channel, I think, but may I ask in case one of you would see an obvious answer? Does anyone have an inkling as to why the file on the left becomes messed up (space and newline literals) after Docker copy? Conclusion: it wasn’t the docker copy the issue, but the fact that the copy didn’t overwrite a previous messed up version of the file, because it was part of a mounted volume.

1
Daniel Jomphe13:11:24

I must have been searching for like 30 minutes and still no idea. File encodings are equivalent. text/plain; charset=us-ascii

Daniel Jomphe13:11:10

What feels the most weird to me in this, is how even leading spaces are added

borkdude13:11:52

Maybe try file encoding utf-8?

elken13:11:30

Windows host?

elken13:11:03

If utf-8 doesn't resolve it

Daniel Jomphe13:11:48

Mac host, docker image built by GitHub’s Codespace environment

Daniel Jomphe13:11:53

Yeah, the file is valid utf-8. I tell VS Code to save it as utf-8 and the resulting encoding reported remains the us-ascii subset of utf-8, because the file doesn’t dip in anything more than the subset.

Daniel Jomphe13:11:20

Ok, I think I got it. The wrong copy must be the output of what I had before the file COPY operation in this dockerfile, but since it’s part of a docker volume, it doesn’t get refreshed by the docker build… "type=volume,source=home-xdg-config,target=/home/codespace/.config", I suppose I can be bit in many ways doing things this way.

1
elken13:11:08

Oh, yeah unless you have a specific reason to do that I probably wouldn't

Daniel Jomphe13:11:15

It was to preserve config changes across dev container rebuilds, if I remember well. But in the past years, nobody ever changed any config, and if they did without contributing to the docker bootstrap, it wouldn’t be ever shared with the team, so I should try removing that.

🙌 1
Daniel Jomphe13:11:56

Thanks a lot for helping me 🙂

❤️ 1
slimslenderslacks16:11:42

We used babashka in the https://github.com/docker/genai-stack to replace some shell scripting (in the Dockerfile here https://github.com/docker/genai-stack/blob/main/pull_model.Dockerfile - this automates a model pull using Ollama). I’ve had a few people reach to express appreciation for the reminder that babashka works nicely for this kind of thing. So I thought I’d pass that on to you here.

❤️ 6
borkdude16:11:13

Thank you, this is always motivating to hear :)