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

Update Dockerfile for grub2disk: #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jacobweinstock
Copy link
Member

Description

The needed packages werent installed in the final image properly.

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

The needed packages werent installed in the
final image properly.

Signed-off-by: Jacob Weinstock <[email protected]>
@displague
Copy link
Member

displague commented Sep 8, 2024

lgtm, I was hesitant about the Docker multiple arch FROM approach, not sure that it was valid, but it is suggested here: https://stackoverflow.com/a/77726353
My initial take is inline with the linked answer, that this could be done with FROM ... {TARGETARCH} and a shell conditional for grub-bios (the only difference).

https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ is a good source for alternate approaches, many examples looking just like this one.

Comment on lines +13 to +17
FROM base AS build-amd64
RUN apk add --no-cache grub grub-bios git ca-certificates gcc musl-dev

FROM base AS build-arm64
RUN apk add --no-cache grub git ca-certificates gcc musl-dev
Copy link

@masteinhauser masteinhauser Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into this same issue when trying to fix an EFI grub installation issue for Ubuntu 22.04. Adding a suggestion here, as feedback given in the PR conversation as possible path forward.

Suggested change
FROM base AS build-amd64
RUN apk add --no-cache grub grub-bios git ca-certificates gcc musl-dev
FROM base AS build-arm64
RUN apk add --no-cache grub git ca-certificates gcc musl-dev
FROM base AS build-${TARGETARCH}
RUN apk add --no-cache grub git ca-certificates gcc musl-dev && \
if [ $TARGETARCH = "amd64" ]; then \
apk add --no-cache grub-bios \
; fi

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

Successfully merging this pull request may close these issues.

3 participants