-
Notifications
You must be signed in to change notification settings - Fork 415
Add concept of a native Dockerfile. #982
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "internal", | ||
"description": "use generic dockerfiles for when the toolchain and image platfom match." | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This dockerfile is used when the target matches the images platform in `build-docker-image` | ||
FROM ubuntu:20.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY common.sh lib.sh / | ||
RUN /common.sh | ||
|
||
COPY cmake.sh / | ||
RUN /cmake.sh | ||
|
||
COPY xargo.sh / | ||
RUN /xargo.sh | ||
|
||
ARG TARGETARCH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is done after the shared code, which will be nice when creating a base image but also for cached layers even before then. |
||
ARG TARGETVARIANT | ||
ARG CROSS_TARGET_TRIPLE | ||
|
||
COPY qemu.sh native-qemu.sh / | ||
RUN /native-qemu.sh | ||
|
||
COPY dropbear.sh / | ||
RUN /dropbear.sh | ||
|
||
COPY linux-image.sh native-linux-image.sh / | ||
RUN /native-linux-image.sh | ||
|
||
COPY linux-runner native-linux-runner base-runner.sh / | ||
|
||
ENV CROSS_TARGETARCH=$TARGETARCH | ||
ENV CROSS_TARGETVARIANT=$TARGETVARIANT | ||
ENV CARGO_TARGET_${CROSS_TARGET_TRIPLE}_RUNNER="/native-linux-runner" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ubuntu:20.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
ARG CROSS_TARGET_TRIPLE | ||
|
||
COPY lib.sh / | ||
COPY linux-image.sh native-linux-image.sh / | ||
RUN /native-linux-image.sh | ||
|
||
FROM centos:7 | ||
|
||
COPY common.sh lib.sh / | ||
RUN /common.sh | ||
|
||
COPY cmake.sh / | ||
RUN /cmake.sh | ||
|
||
COPY xargo.sh / | ||
RUN /xargo.sh | ||
|
||
# these need to be present in **both** FROM sections | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
ARG CROSS_TARGET_TRIPLE | ||
|
||
COPY qemu.sh native-qemu.sh / | ||
RUN /native-qemu.sh | ||
|
||
COPY dropbear.sh / | ||
RUN /dropbear.sh | ||
|
||
COPY --from=0 /qemu /qemu | ||
|
||
COPY linux-runner native-linux-runner base-runner.sh / | ||
|
||
ENV CROSS_TARGETARCH=$TARGETARCH | ||
ENV CROSS_TARGETVARIANT=$TARGETVARIANT | ||
ENV CARGO_TARGET_${CROSS_TARGET_TRIPLE}_RUNNER="/native-linux-runner" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
Alexhuszagh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set -x | ||
set -eo pipefail | ||
|
||
# shellcheck disable=SC1091 | ||
. lib.sh | ||
Emilgardis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
main() { | ||
local arch | ||
arch=$(docker_to_linux_arch "${TARGETARCH}" "${TARGETVARIANT}") | ||
/linux-image.sh "${arch}" | ||
rm "${0}" | ||
} | ||
|
||
main "${@}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
# shellcheck disable=SC1091 | ||
. /lib.sh | ||
|
||
main() { | ||
Alexhuszagh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
local arch | ||
arch=$(docker_to_linux_arch "${CROSS_TARGETARCH}" "${CROSS_TARGETVARIANT}") | ||
|
||
if [[ -z "${CROSS_RUNNER}" ]]; then | ||
export CROSS_RUNNER=native | ||
fi | ||
|
||
exec /linux-runner "${arch}" "${@}" | ||
} | ||
|
||
main "${@}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEA9
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
Alexhuszagh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set -x | ||
set -euo pipefail | ||
|
||
# shellcheck disable=SC1091 | ||
. lib.sh | ||
|
||
main() { | ||
local arch | ||
arch=$(docker_to_qemu_arch "${TARGETARCH}") | ||
/qemu.sh "${arch}" softmmu | ||
rm "${0}" | ||
} | ||
|
||
main "${@}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.