Skip to content

Commit

Permalink
attempt to separate amd and arm
Browse files Browse the repository at this point in the history
  • Loading branch information
spenceradolph committed Apr 14, 2024
1 parent eec840b commit c14da8e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
49 changes: 45 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env:

jobs:
# Builds the base container image and pushes it to the container registry
agent_build:
agent_build_amd:
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -79,12 +79,12 @@ jobs:
org.opencontainers.image.source=${{ env.IMAGE_SOURCE }}
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }}
platforms: linux/amd64,linux/arm64
platforms: linux/amd64

update_files:
runs-on: ubuntu-latest
needs:
- agent_build
- agent_build_amd
permissions:
contents: write
packages: write
Expand Down Expand Up @@ -136,4 +136,45 @@ jobs:
push: origin HEAD:${{ env.RELEASE_BRANCH }} --set-upstream

# Have the workflow fail in case there are pathspec issues
pathspec_error_handling: exitImmediately
pathspec_error_handling: exitImmediately

agent_build_arm:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4 # ref: https://github.com/marketplace/actions/checkout
- name: Log in to the container registry
uses: docker/login-action@v3 # ref: https://github.com/marketplace/actions/docker-login
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# the following are unique to this job
- name: Lowercase the server container image name
run: echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> ${GITHUB_ENV}
- name: Build and push the server container image
uses: docker/build-push-action@v5 # ref: https://github.com/marketplace/actions/build-and-push-docker-images
with:
context: Payload_Type/sliverapi
file: Payload_Type/sliverapi/Dockerfile
tags: |
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:${{ env.VERSION }}
${{ env.REGISTRY }}/${{ env.AGENT_IMAGE_NAME }}:latest
push: ${{ github.ref_type == 'tag' }}
# These container metadata labels allow configuring the package in Github
# packages. The source will link the package to this Github repository
labels: |
org.opencontainers.image.source=${{ env.IMAGE_SOURCE }}
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
org.opencontainers.image.licenses=${{ env.IMAGE_LICENSE }}
platforms: linux/arm64
4 changes: 4 additions & 0 deletions Payload_Type/sliverapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ COPY --from=builder /grpc_wheel /grpc_wheel
RUN pip install --no-cache /other_wheels/*
RUN pip install --no-cache /grpc_wheel/*

WORKDIR /Mythic/

COPY [".", "."]

CMD ["python3", "main.py"]
4 changes: 4 additions & 0 deletions Payload_Type/sliverimplant/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ COPY --from=builder /grpc_wheel /grpc_wheel
RUN pip install --no-cache /other_wheels/*
RUN pip install --no-cache /grpc_wheel/*

WORKDIR /Mythic/

COPY [".", "."]

CMD ["python3", "main.py"]

0 comments on commit c14da8e

Please sign in to comment.