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

chore: install deps and create foundry user in cross built image #9775

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

grandizzy
Copy link
Collaborator

Motivation

  • install git and create foundry user inside Docker image - needed to build a project mounted inside container
  • use same alpine image as regular Dockerfile

    foundry/Dockerfile

    Lines 33 to 42 in 2509ce2

    FROM alpine:3.20 as foundry-client
    RUN apk add --no-cache linux-headers git gcompat libstdc++
    COPY --from=build-environment /opt/foundry/out/forge /usr/local/bin/forge
    COPY --from=build-environment /opt/foundry/out/cast /usr/local/bin/cast
    COPY --from=build-environment /opt/foundry/out/anvil /usr/local/bin/anvil
    COPY --from=build-environment /opt/foundry/out/chisel /usr/local/bin/chisel
    RUN adduser -Du 1000 foundry

Solution

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

makes sense

COPY ./dist/bin/$TARGETARCH/* /usr/local/bin/

RUN adduser -Du 1000 foundry
Copy link
Member

Choose a reason for hiding this comment

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

I remember having to do something like this a while ago on something else

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, for this case is for being able to map host user to container user so there's no issue with volumes mapped permissions (resulting in git failure fatal: detected dubious ownership in repository)

@grandizzy grandizzy merged commit f3548cb into foundry-rs:master Jan 28, 2025
22 checks passed
@grandizzy grandizzy deleted the docker-fix branch January 28, 2025 19:17
@grandizzy grandizzy added the L-ignore Log: ignore PR in changelog label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-ignore Log: ignore PR in changelog
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants