Skip to content

Commit

Permalink
Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBellew authored May 27, 2024
1 parent 7ef4ec3 commit 0b7b624
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 36 additions & 0 deletions Dockerfile.mac
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0b7b624

Please sign in to comment.