-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from WeihanLi/dev
0.9.0
- Loading branch information
Showing
45 changed files
with
262 additions
and
383 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -349,3 +349,6 @@ MigrationBackup/ | |
|
||
# Ionide (cross platform F# VS Code tools) working folder | ||
.ionide/ | ||
|
||
# customize files | ||
out/ |
This file contains 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 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 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 |
---|---|---|
@@ -1,23 +1,44 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine AS base | ||
LABEL Maintainer="WeihanLi" | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64-musl AS cross-build-env | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build-env | ||
|
||
# Install NativeAOT build prerequisites | ||
# RUN apk update && apk add clang gcc lld musl-dev build-base zlib-dev | ||
COPY --from=cross-build-env /crossrootfs /crossrootfs | ||
|
||
ARG TARGETARCH | ||
ARG BUILDARCH | ||
|
||
# Configure NativeAOT Build Prerequisites | ||
# https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=linux-alpine%2Cnet8 | ||
# for alpine | ||
RUN apk update && apk add clang build-base zlib-dev | ||
# for debian/ubuntu | ||
# RUN apt-get update && apt-get install -y clang zlib1g-dev | ||
|
||
WORKDIR /app | ||
|
||
COPY ./src/ ./src/ | ||
COPY ./build/ ./build/ | ||
COPY ./Directory.Build.props ./ | ||
COPY ./Directory.Build.targets ./ | ||
COPY ./Directory.Packages.props ./ | ||
COPY ./.editorconfig ./ | ||
|
||
WORKDIR /app/src/HTTPie/ | ||
RUN dotnet publish -f net8.0 -c Release --self-contained --use-current-runtime -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:AssemblyName=http -p:TargetFrameworks=net8.0 -o /app/artifacts | ||
|
||
FROM base AS final | ||
COPY --from=build-env /app/artifacts/http /root/.dotnet/tools/http | ||
RUN ln -s /root/.dotnet/tools/http /root/.dotnet/tools/dotnet-http | ||
ENV PATH="/root/.dotnet/tools:${PATH}" | ||
ENTRYPOINT ["http"] | ||
RUN if [ "${TARGETARCH}" = "${BUILDARCH}" ]; then \ | ||
dotnet publish -f net9.0 --use-current-runtime -p:AssemblyName=http -p:TargetFrameworks=net9.0 -o /app/artifacts; \ | ||
else \ | ||
apk add binutils-aarch64 --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community; \ | ||
dotnet publish -f net9.0 -r linux-musl-arm64 -p:AssemblyName=http -p:TargetFrameworks=net9.0 -p:SysRoot=/crossrootfs/arm64 -p:ObjCopyName=aarch64-alpine-linux-musl-objcopy -o /app/artifacts; \ | ||
fi | ||
|
||
FROM alpine | ||
|
||
# https://github.com/opencontainers/image-spec/blob/main/annotations.md | ||
LABEL org.opencontainers.image.authors="WeihanLi" | ||
LABEL org.opencontainers.image.source="https://github.com/WeihanLi/dotnet-httpie" | ||
|
||
COPY --from=build-env /app/artifacts/http /usr/bin/http | ||
RUN chmod +x /usr/bin/http | ||
ENTRYPOINT ["/usr/bin/http"] | ||
CMD ["--help"] |
This file contains 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.