Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Dockerfile for alpine not working #83

Closed
naumannt opened this issue Jul 29, 2020 · 11 comments · Fixed by Homebrew/brew#8324
Closed

Dockerfile for alpine not working #83

naumannt opened this issue Jul 29, 2020 · 11 comments · Fixed by Homebrew/brew#8324
Assignees

Comments

@naumannt
Copy link

The Dockerfile at https://github.com/Linuxbrew/docker/tree/master/alpine does not result in a successful build.
Fails at step 8 (homebrew installation command) with
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.sh: line 15: locale: command not found

I used 'docker build' without any modifications to the Dockerfile.

@sjackman
Copy link
Member

sjackman commented Aug 4, 2020

@maxim-belkin Alpine Linux does not include the locale command by default, and it doesn't appear straight forward to add it.
See gliderlabs/docker-alpine#144
and https://grrr.tech/posts/2020/add-locales-to-alpine-linux-docker-image/
and https://stackoverflow.com/questions/49042223/how-to-set-locale-in-docker-alpine

Would you like to open a PR to set LC_ALL=C when the locale command is missing?

@sjackman
Copy link
Member

sjackman commented Aug 4, 2020

On second thought, locale: command not found looks like a red herring. That error should not be fatal, though annoying to look at.

$ docker build alpine
HEAD is now at e76cea16b Merge pull request #8213 from dtrodrigues/homepage-style
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.sh: line 15: locale: command not found
/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- fiddle (LoadError)
	from /usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/linkage_checker.rb:6:in `<top (required)>'

Failed during: /home/linuxbrew/.linuxbrew/bin/brew update --force

The fatal error message is 'require': cannot load such file -- fiddle (LoadError).

@sjackman
Copy link
Member

sjackman commented Aug 4, 2020

@naumannt There is a linuxbrew/alpine Docker image built two months ago here: https://hub.docker.com/r/linuxbrew/alpine
docker run linuxbrew/alpine
See https://github.com/Linuxbrew/docker#alpine-6

@sjackman
Copy link
Member

sjackman commented Aug 5, 2020

-	&& apk --no-cache add bash coreutils curl file g++ grep git libc6-compat make ruby ruby-bigdecimal ruby-etc ruby-irb ruby-json ruby-test-unit sudo \
+	&& apk --no-cache add bash coreutils curl file g++ grep git libc6-compat make ruby ruby-bigdecimal ruby-etc ruby-fiddle ruby-irb ruby-json ruby-test-unit sudo \

&& apk --no-cache add bash coreutils curl file g++ grep git libc6-compat make ruby ruby-bigdecimal ruby-etc ruby-irb ruby-json ruby-test-unit sudo \

Adding ruby-fiddle would likely fix this issue.
@naumannt Would you like to open a PR to make this change? Please insert ruby-fiddle in alphabetical order on this line.

@maxim-belkin maxim-belkin self-assigned this Aug 7, 2020
@maxim-belkin
Copy link
Contributor

I'll look into this tonight/tomorrow.

@maxim-belkin
Copy link
Contributor

@sjackman
We can install glibc on alpine, see https://github.com/sgerrand/alpine-pkg-glibc. Do we want to do that?

If not, shall we add logic to account for situations when locale command does not exist?

@maxim-belkin
Copy link
Contributor

we can also do something along the lines of gliderlabs/docker-alpine#144 (comment)

@sjackman
Copy link
Member

The alpine/Dockerfile installs brewed glibc which includes locale. It'd be better I think if Homebrew/brew successfully handled the situation of locale missing by falling back to the locale C.

@sjackman
Copy link
Member

I think it works already though. It just prints an "error" that is ignored.

The real hard error was The fatal error message is 'require': cannot load such file -- fiddle (LoadError)..

@maxim-belkin
Copy link
Contributor

The real hard error was The fatal error message is 'require': cannot load such file -- fiddle (LoadError)..

I submitted a PR for that

@sjackman
Copy link
Member

I submitted a PR for that

I'll get a notification if you request me as a reviewer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants