Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build multi-platform image #373

Open
igoberman opened this issue Jan 12, 2024 · 0 comments
Open

Cannot build multi-platform image #373

igoberman opened this issue Jan 12, 2024 · 0 comments

Comments

@igoberman
Copy link

igoberman commented Jan 12, 2024

Hi I followed your instructions to build a custom docker image based on https://github.com/fluent/fluentd-docker-image

My docker file is below
`FROM fluent/fluentd:v1.16.2-1.1
MAINTAINER YOUR_NAME <...@...>

USER root

RUN apk add --no-cache --update --virtual .build-deps
sudo build-base ruby-dev
&& sudo gem install fluent-plugin-cloudwatch-logs
&& sudo gem sources --clear-all
&& apk del .build-deps
&& rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem

COPY fluent.conf /fluentd/etc/
COPY entrypoint.sh /bin/

USER fluent`

I then run buildx command below to create multi platform image for amd64 and arm64 linux.

docker buildx build --push --builder=container --platform=linux/amd64,linux/arm64 -t barchart/barchart-fluentd:3.0 ./

However, I am getting this error. I am doing the build on Mac. Do you know what I am doing wrong?
Thanks

#0 12.88 OK: 270 MiB in 54 packages #0 15.13 ERROR: While executing gem ... (Gem::FilePermissionError) #0 15.13 You don't have write permissions for the /usr/lib/ruby/gems/3.1.0 directory. #0 15.13 /usr/lib/ruby/3.1.0/rubygems/installer.rb:712:in verify_gem_home'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/installer.rb:902:in pre_install_checks' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/installer.rb:302:in install'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/resolver/specification.rb:104:in install' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/request_set.rb:194:in block in install'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/request_set.rb:182:in each' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/request_set.rb:182:in install'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:210:in install_gem' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:226:in block in install_gems'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:219:in each' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:219:in install_gems'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:167:in execute' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/command.rb:323:in invoke_with_build_args'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/command_manager.rb:185:in process_args' #0 15.13 /usr/lib/ruby/3.1.0/rubygems/command_manager.rb:149:in run'
#0 15.13 /usr/lib/ruby/3.1.0/rubygems/gem_runner.rb:51:in run' #0 15.13 /usr/bin/gem:21:in '

ERROR: failed to solve: executor failed running [/bin/sh -c apk add --no-cache --update --virtual .build-deps sudo build-base ruby-dev && sudo gem install fluent-plugin-cloudwatch-logs && sudo gem sources --clear-all && apk del .build-deps && rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem]: buildkit-runc did not terminate successfully
`

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

No branches or pull requests

1 participant