-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mercury-internal/trunk'
- Loading branch information
Showing
24 changed files
with
2,040 additions
and
152 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Docker Image Build and Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- docker-autobuild | ||
|
||
jobs: | ||
build-and-push-image: | ||
permissions: | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Compute Docker image tags | ||
id: set-tags | ||
run: | | ||
shortSHA=$(git rev-parse --short ${{ github.sha }}) | ||
echo "shatag=$shortSHA" >> "$GITHUB_OUTPUT" | ||
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
echo "tag=latest" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "tag=test" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Build Docker image and publish to GitHub Container Registry | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ steps.set-tags.outputs.shatag }} | ||
ghcr.io/${{ github.repository }}:${{ steps.set-tags.outputs.tag }} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### | ||
## This Dockerfile provides an easy way to try mercury. | ||
# | ||
# Run this once: | ||
# docker build -t mercury:default . | ||
# | ||
# Run mercury: | ||
# docker run --rm -i --entrypoint /usr/local/bin/mercury \ | ||
# --volume .:/root mercury:default <args> <for> <mercury> | ||
# | ||
# You can then set this as a bash alias in your .bashrc: | ||
# alias mercury='docker run --rm -i --entrypoint /usr/local/bin/mercury --volume .:/root mercury:default' | ||
# | ||
# In each of the commands above, feel free to replace name of the docker image | ||
# (mercury:default) with a different name/tag of your choosing, as long as it | ||
# remains consistent across the commands. | ||
# | ||
# The host's current working directory (.) will be mounted as the container's | ||
# current working directory (/root). This provides mercury some read and write | ||
# access to the host filesystem, such as a pcap file in your current directory. | ||
|
||
FROM alpine:latest | ||
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories \ | ||
&& apk add --no-cache build-base git make gcc g++ linux-headers pkgconfig \ | ||
wget tar zlib-dev openssl-dev musl-dev libc-dev gmp-dev | ||
|
||
COPY . /src | ||
WORKDIR /src | ||
RUN ./configure \ | ||
&& make V=s use_fsanitize=no \ | ||
&& make batch_gcd --dir=src \ | ||
&& make tls_scanner --dir=src \ | ||
&& make install-nonroot \ | ||
&& make install-certtools | ||
|
||
FROM alpine:latest | ||
WORKDIR /root/ | ||
COPY --from=0 /usr/local /usr/local | ||
RUN apk add --no-cache libstdc++ gmp | ||
RUN addgroup mercury -S && adduser mercury -G mercury -S && \ | ||
chown -R mercury:mercury /usr/local/share/mercury /usr/local/var/mercury/ | ||
|
||
# Default entrypoint for "docker run" on this image | ||
ENTRYPOINT ["/usr/local/bin/mercury"] | ||
|
||
# Other possibilities (edit this file or specify via --entrypoint at run time) | ||
# ENTRYPOINT ["/usr/local/bin/mercury", "-u", "mercury", "-c", "eth0"] | ||
# ENTRYPOINT ["/usr/local/bin/batch_gcd"] | ||
# ENTRYPOINT ["/usr/local/bin/cert_analyze"] | ||
# ENTRYPOINT ["/usr/local/bin/tls_scanner"] | ||
# ENTRYPOINT ["/bin/sh"] |
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 +1 @@ | ||
2.5.19 | ||
2.5.20 |
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.