diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e0394d..50d8c3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,24 +31,25 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('Dockerfile') }} - restore-keys: | - ${{ runner.os }}-buildx-${{ github.ref }}- - ${{ runner.os }}-buildx- + # - name: Cache Docker layers + # uses: actions/cache@v2 + # with: + # path: /tmp/.buildx-cache + # key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('Dockerfile') }} + # restore-keys: | + # ${{ runner.os }}-buildx-${{ github.ref }}- + # ${{ runner.os }}-buildx- - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest - platforms: linux/amd64,linux/arm64 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Verify multi-architecture image - run: docker run --rm ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest uname -m + file: Dockerfile.mac + #push: true + #tags: ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest + platforms: linux/arm64 #linux/amd64, + # cache-from: type=local,src=/tmp/.buildx-cache + # cache-to: type=local,dest=/tmp/.buildx-cache + + # - name: Verify multi-architecture image + # run: docker run --rm ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest uname -m diff --git a/Dockerfile.mac b/Dockerfile.mac new file mode 100644 index 0000000..69f4631 --- /dev/null +++ b/Dockerfile.mac @@ -0,0 +1,36 @@ + +FROM ubuntu:noble-20240429 + +RUN apt-get update +RUN apt-get install -y wget + +WORKDIR /app + +RUN apt-get install -y build-essential systemtap-sdt-dev libreadline-dev zlib1g-dev libsystemd-dev libicu-dev + +# Install rust +RUN apt-get update +RUN apt install -y curl git linux-tools-common libelf-dev pkgconf +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustup toolchain install nightly-aarch64-unknown-linux-gnu +RUN rustup default nightly-aarch64-unknown-linux-gnu + +# Install bpf tools' +RUN apt-get install -y llvm-18-dev libclang-18-dev libpolly-18-dev +RUN cargo install bpf-linker --no-default-features +WORKDIR /app +RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git +WORKDIR /app/bpftool/src +RUN make install + +#COPY aya/myapp /app + +#RUN rustup update +RUN rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu + +WORKDIR /app + +COPY /apps /app +RUN cargo xtask build-ebpf --release +RUN cargo build --release \ No newline at end of file