document how to build under alpine#4353
Conversation
| To build under alpine linux, whether booted alpine or in a container: | ||
|
|
||
| ```sh | ||
| apk add make gcc libseccomp-dev musl-dev linux-headers git |
There was a problem hiding this comment.
- Is ‘git’ really necessary?
- Even in the main Readme, there is no introduction to tell users to install gcc or musl, I think it’s the basic info that we should know. So if we want add some information about pre-requirements of build, the best place should be ‘../README.md’.
- This file is not referenced by any other files.
WDYT?
There was a problem hiding this comment.
Yeah git is necessary. Go uses it under the covers as far as I know. I ran make runc and got an error for missing git.
Sure. Maybe this whole doc should be "prerequisites.md", cover both glibc and musl based OSes, and linked from README?
I'm more than happy to change this around as needed, as long as I know it will get accepted at the end.
Thoughts?
There was a problem hiding this comment.
For my personal, I think we should add ‘pre-requirements.md’, because if we clone the repository to local for the first time, we usually can’t compile runc successfully in a big possibility, especially in GitHub online codespace. But we should consider other maintainers’ option.
There was a problem hiding this comment.
git isn't necessary for building. Our Makefile does use git to get the commit information to embed in the binary, but you can do make COMMIT="" to disable that. Go doesn't require git either (we vendor our dependencies, so you can build offline).
Also, the build will still work even with the warning -- $(shell ...) doesn't abort the build. Maybe we should silence errors for COMMIT ?= but that's a minor change.
There was a problem hiding this comment.
Ah, ok. I didn't pay close enough attention to realize the deps had been vendored, so git would not be necessary.
Although, if the normal make path expects git, then I think listing git as a dependency makes sense. I can always add a comment about leaving it out if you do not include the commit as make COMMIT="".
In any case, what did we decide here? Do we want to make this a generic "prerequirements.md" or "build-requirements.md" or even just "building.md"/"build.md" and link from the main README.md?
AkihiroSuda
left a comment
There was a problem hiding this comment.
This should be merged to https://github.com/opencontainers/runc/blob/main/README.md#building
94e5662 to
f8eae81
Compare
|
OK, I merged all of this into the section in README that @AkihiroSuda recommended, added apt and yum commands for centOS, and moved the comment about optional seccomp to that section. Ready for next run of review. |
419ef87 to
e9ab2b4
Compare
Signed-off-by: Avi Deitcher <avi@deitcher.net>
e9ab2b4 to
6fc2733
Compare
|
Yes correct. I ran each of these commands on the specific distro. |
I had to build under alpine (musl), so I documented it. Hopefully this is helpful for others.