├── .dockerignore ├── .github └── workflows │ └── build.yml ├── Dockerfile ├── README.md └── entrypoint.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'v2' 7 | tags: 8 | - '2.*' 9 | 10 | jobs: 11 | docker: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - 15 | name: Checkout 16 | uses: actions/checkout@v4 17 | - 18 | name: Docker meta 19 | id: docker_meta 20 | uses: docker/metadata-action@v5 21 | with: 22 | images: blackfire/blackfire 23 | tags: | 24 | type=ref,event=branch 25 | type=ref,event=tag 26 | type=raw,value=2 27 | - 28 | name: Set up QEMU 29 | uses: docker/setup-qemu-action@v3 30 | - 31 | name: Set up Docker Buildx 32 | uses: docker/setup-buildx-action@v3 33 | - 34 | name: Login to DockerHub 35 | uses: docker/login-action@v3 36 | with: 37 | username: ${{ secrets.DOCKERHUB_USERNAME }} 38 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 39 | - 40 | name: Build and push 41 | uses: docker/build-push-action@v6 42 | with: 43 | context: . 44 | platforms: linux/amd64,linux/386,linux/arm64 45 | push: true 46 | tags: ${{ steps.docker_meta.outputs.tags }} 47 | labels: ${{ steps.docker_meta.outputs.labels }} 48 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21 AS bin 2 | 3 | ARG TARGETARCH 4 | 5 | ADD https://packages.blackfire.io/binaries/blackfire/2.28.25/blackfire-linux_${TARGETARCH:-amd64} /usr/local/bin/blackfire 6 | RUN chmod 0555 /usr/local/bin/blackfire 7 | 8 | FROM alpine:3.21 9 | 10 | ENV BLACKFIRE_CONFIG /dev/null 11 | ENV BLACKFIRE_LOG_LEVEL 1 12 | ENV BLACKFIRE_SOCKET tcp://0.0.0.0:8307 13 | EXPOSE 8307 14 | 15 | RUN apk add --no-cache curl socat ca-certificates \ 16 | && addgroup -S blackfire \ 17 | && adduser -S -H -G blackfire -u 999 blackfire 18 | 19 | COPY entrypoint.sh /usr/local/bin/ 20 | COPY --from=bin /usr/local/bin/blackfire /usr/local/bin/blackfire 21 | 22 | # Don't run as root 23 | USER blackfire 24 | 25 | HEALTHCHECK CMD blackfire agent:healthcheck 26 | 27 | CMD ["blackfire", "agent:start"] 28 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository is the home of the `blackfire/blackfire` Docker image published on [Dockerhub](https://hub.docker.com/r/blackfire/blackfire). 2 | 3 | # Quick reference 4 | 5 | * [Blackfire integration with Docker](https://docs.blackfire.io/up-and-running/docker) 6 | * [Blackfire tutorial on performance management](https://docs.blackfire.io/php/training-resources/book/index) 7 | * Support: support@blackfire.io 8 | 9 | # What is Blackfire? 10 | 11 | ## Performance Testing 12 | 13 | [Blackfire.io](https://blackfire.io/) helps you make sure you never let your 14 | application load times frustrate a user. 15 | Blackfire lets you thoroughly test your code according to your business logic. 16 | 17 | ## Performance Management Automation 18 | 19 | Automate testing and improve your application performance continuously, in 20 | development, staging, or production. 21 | Integrate performance management seamlessly in your existing workflows and tools. 22 | 23 | ## Performance Profiling 24 | 25 | Gather detailed performance metrics from your code’s execution, and visualize 26 | it in Blackfire.io interactive call graphs and with a timeline view. 27 | Find bottlenecks in the blink of an eye and check the impact of your changes 28 | by comparing iterations in development, staging, and production servers. 29 | 30 | # How to use this Image? 31 | 32 | Please read out the [Blackfire integration documentation with Docker](https://docs.blackfire.io/up-and-running/docker). 33 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Since the version 2 of the blackfire CLI, the default port has been changed from 8707 to 8307. 4 | # To ease the migration, we create a tunnel from the old port to the new one if the user lets the 5 | # default configuration and didn't set the BLACKFIRE_DISABLE_LEGACY_PORT environment variable. 6 | if [ "${BLACKFIRE_SOCKET}" == "tcp://0.0.0.0:8307" ] && [ -z "${BLACKFIRE_DISABLE_LEGACY_PORT}" ] ; then 7 | echo "Starting the port forwarder between port 8707 to 8307." 8 | echo "Please ensure you use the new port (8307)." 9 | echo "If you are not using the legacy port (8707), you can ignore this message." 10 | echo "To get rid of this message, you must set a non-null value to the BLACKFIRE_DISABLE_LEGACY_PORT environment variable" 11 | socat tcp-listen:8707,reuseaddr,fork tcp:localhost:8307 >/dev/null 2>&1 & 12 | fi 13 | 14 | exec "$@" 15 | --------------------------------------------------------------------------------