Skip to content
New issue

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

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

Already on GitHub? # to your account

Specify C compiler in build cross-compilation #548

Merged
merged 30 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f5c2f77
delete relic dockerfile and enable cgo
Jan 10, 2024
cb4bb0f
add CC flag in go build
Jan 10, 2024
6fb4fc9
tmp: enable docker job for fast checking
Jan 10, 2024
a342592
improve apt-get call
Jan 10, 2024
e83f95f
fix arm arch name
Jan 10, 2024
0a57ef5
improve setting C_COMPILER
Jan 10, 2024
6a03566
try another if else method
Jan 10, 2024
9a21375
multistage build
Jan 10, 2024
5eafc19
Revert "multistage build"
Jan 10, 2024
f7d033d
put mount commands upfront
Jan 11, 2024
9f50ee8
use arm64 compiler
Jan 12, 2024
bea5fc2
remove arm64 compiler install
Jan 12, 2024
e6eeda3
Revert "remove arm64 compiler install"
Jan 12, 2024
4007c30
use gcc-13
Jan 12, 2024
47c0d0c
Revert "use gcc-13"
Jan 12, 2024
4bcea13
update arm64 gcc name
Jan 12, 2024
3b1f20e
add cc path
Jan 12, 2024
5879087
debug
Jan 12, 2024
d9d8d46
update arm64 gcc name
Jan 12, 2024
4106378
use x86_64 gcc
Jan 12, 2024
ad75821
Merge branch 'master' into tarak/fix-build
tarakby Jan 12, 2024
aa1a3e4
compile without adx instructions
Jan 12, 2024
713430a
Merge branch 'tarak/fix-build' of github.com:onflow/flow-emulator int…
Jan 12, 2024
d943ea0
update x86_64 gcc name
Jan 12, 2024
5a8082d
remove installing gcc-x86_64-linux-gnu
Jan 12, 2024
d44a5a8
Revert "tmp: enable docker job for fast checking"
Jan 12, 2024
59f48e3
refactor dockerfile go build
Jan 31, 2024
6ea64e9
fix dockerfile bug
Jan 31, 2024
700ba0c
Merge branch 'master' into tarak/fix-build
tarakby Jan 31, 2024
4ff4de9
Merge branch 'master' into tarak/fix-build
franklywatson Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
args: --timeout=10m

docker:
if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/')
needs: test
name: "Docker image"
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 15 additions & 3 deletions cmd/emulator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@ WORKDIR /app
# add the pubkey of github.com to knownhosts, so ssh-agent doesn't bark
RUN mkdir -p /root/.ssh && ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
RUN git config --global 'url.ssh://git@github.com/.insteadOf' https://github.com/
RUN apt-get update
RUN apt-get -y install apt-utils gcc-arm-linux-gnueabi

COPY . .

ARG TARGETOS
ARG TARGETARCH
RUN --mount=type=ssh \
RUN if [ "$TARGETARCH" = "arm64" ] ; then \
--mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GO111MODULE=on CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator
GO111MODULE=on CGO_ENABLED=1 GOOS=$TARGETOS \
GOARCH=$TARGETARCH CC=arm-linux-gnueabi-gcc \
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator ; \
elif [ "$TARGETARCH" = "amd64" ] ; then \
--mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GO111MODULE=on CGO_ENABLED=1 GOOS=$TARGETOS \
GOARCH=$TARGETARCH CC=gcc \
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator ; \
fi

## Add the binary to a fresh distroless image
FROM gcr.io/distroless/static
Expand Down
55 changes: 0 additions & 55 deletions cmd/emulator/Dockerfile.relic

This file was deleted.

Loading