├── .github └── workflows │ └── docker-publish.yml ├── Dockerfile ├── LICENSE ├── README.md ├── compose.yaml └── docker-entrypoint.sh /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Docker 2 | 3 | on: 4 | push: 5 | # Publish semver tags as releases. 6 | tags: [ 'v*.*.*' ] 7 | 8 | env: 9 | REGISTRY: docker.io 10 | IMAGE_NAME: fanout/pushpin 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | - name: Set up Docker Buildx 19 | uses: docker/setup-buildx-action@v3 20 | - name: Get source version 21 | run: echo "SOURCE_VERSION=$(grep VERSION compose.yaml | awk {'print $2'})" >> "$GITHUB_ENV" 22 | - name: Docker meta 23 | id: meta 24 | uses: docker/metadata-action@v5 25 | with: 26 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 27 | tags: | 28 | type=ref,event=branch 29 | type=semver,pattern={{version}} 30 | - name: Login to registry ${{ env.REGISTRY }} 31 | if: github.event_name != 'pull_request' 32 | uses: docker/login-action@v3 33 | with: 34 | registry: ${{ env.REGISTRY }} 35 | username: ${{ secrets.DOCKER_USERNAME }} 36 | password: ${{ secrets.DOCKER_PASSWORD }} 37 | - name: Build and push 38 | uses: docker/build-push-action@v5 39 | with: 40 | context: . 41 | build-args: | 42 | VERSION=${{ env.SOURCE_VERSION }} 43 | platforms: linux/amd64,linux/arm64 44 | push: ${{ github.event_name != 'pull_request' }} 45 | tags: ${{ steps.meta.outputs.tags }} 46 | labels: ${{ steps.meta.outputs.labels }} 47 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Pushpin Dockerfile 3 | # 4 | # https://github.com/fanout/docker-pushpin 5 | # 6 | 7 | # Pull the base image 8 | FROM ubuntu:24.10 as build 9 | 10 | # Install deps 11 | RUN \ 12 | apt-get update && \ 13 | apt-get install -y bzip2 pkg-config make g++ rustc cargo libssl-dev qtbase5-dev libzmq3-dev libboost-dev 14 | 15 | WORKDIR /build 16 | 17 | ARG VERSION 18 | 19 | ADD https://github.com/fastly/pushpin/releases/download/v${VERSION}/pushpin-${VERSION}.tar.bz2 . 20 | 21 | RUN tar xf pushpin-${VERSION}.tar.bz2 && mv pushpin-${VERSION} pushpin 22 | 23 | WORKDIR /build/pushpin 24 | 25 | RUN make RELEASE=1 PREFIX=/usr CONFIGDIR=/etc 26 | RUN make RELEASE=1 PREFIX=/usr CONFIGDIR=/etc check 27 | RUN make RELEASE=1 PREFIX=/usr CONFIGDIR=/etc INSTALL_ROOT=/build/out install 28 | 29 | FROM ubuntu:24.10 30 | MAINTAINER Justin Karneges 31 | 32 | RUN \ 33 | apt-get update && \ 34 | apt-get install -y --no-install-recommends libqt5core5a libqt5network5 libzmq5 && \ 35 | apt-get -y autoremove && \ 36 | apt-get -y clean && \ 37 | rm -rf /var/lib/apt/lists/* 38 | 39 | COPY --from=build /build/out/ / 40 | 41 | # Add entrypoint script 42 | COPY docker-entrypoint.sh /usr/local/bin/ 43 | 44 | # Define default entrypoint and command 45 | ENTRYPOINT ["docker-entrypoint.sh"] 46 | CMD ["pushpin", "--merge-output"] 47 | 48 | # Expose ports. 49 | # - 7999: HTTP port to forward on to the app 50 | # - 5560: ZMQ PULL for receiving messages 51 | # - 5561: HTTP port for receiving messages and commands 52 | # - 5562: ZMQ SUB for receiving messages 53 | # - 5563: ZMQ REP for receiving commands 54 | EXPOSE 7999 55 | EXPOSE 5560 56 | EXPOSE 5561 57 | EXPOSE 5562 58 | EXPOSE 5563 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 John Jelinek IV 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pushpin Dockerfile 2 | 3 | 4 | This repository contains **Dockerfile** of [Pushpin](http://pushpin.org/) for [Docker](https://www.docker.com/) published to the public [Docker Hub Registry](https://hub.docker.com/). 5 | 6 | ## Base Docker Image 7 | 8 | * [ubuntu:24.10](https://hub.docker.com/_/ubuntu/) 9 | 10 | ## Installation 11 | 12 | 1. Install [Docker](https://www.docker.com/). 13 | 14 | 2. Download [automated build](https://hub.docker.com/r/fanout/pushpin/) from public [Docker Hub Registry](https://hub.docker.com/): `docker pull fanout/pushpin` 15 | 16 | Alternatively, you can build an image from the `Dockerfile`. The easiest way to do this is with `docker-compose`, which picks up the source & image versions from `compose.yaml`: 17 | 18 | ```sh 19 | docker-compose build 20 | ``` 21 | 22 | Or you can build with `docker` and manually specify the versions: 23 | 24 | ```sh 25 | docker build --build-arg VERSION={SOURCE_VERSION} -t fanout/pushpin:{IMAGE_VERSION} . 26 | ``` 27 | 28 | ## Usage 29 | 30 | ```sh 31 | docker run \ 32 | -d \ 33 | -p 7999:7999 \ 34 | -p 5560-5563:5560-5563 \ 35 | --rm \ 36 | --name pushpin \ 37 | fanout/pushpin 38 | ``` 39 | 40 | By default, Pushpin routes traffic to a test handler. See the [Getting Started Guide](https://pushpin.org/docs/getting-started/) for more information. 41 | 42 | Open `http://:7999` to see the result. 43 | 44 | #### Configure Pushpin to route traffic 45 | 46 | To add custom Pushpin configuration to your Docker container, attach a configuration volume. 47 | 48 | ```sh 49 | docker run \ 50 | -d \ 51 | -p 7999:7999 \ 52 | -p 5560-5563:5560-5563 \ 53 | -v $(pwd)/config:/etc/pushpin/ \ 54 | --rm \ 55 | --name pushpin \ 56 | fanout/pushpin 57 | ``` 58 | 59 | Note: The Docker entrypoint may make modifications to `pushpin.conf` so it runs properly in its container, exposing ports `7999`, `5560`, `5561`, `5562`, and `5563`. 60 | 61 | See project documentation for more on [configuring Pushpin](https://pushpin.org/docs/configuration/). 62 | -------------------------------------------------------------------------------- /compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | pushpin: 3 | build: 4 | context: . 5 | args: 6 | VERSION: 1.40.1 7 | image: fanout/pushpin:1.40.1-1 8 | -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ -w /etc/pushpin/pushpin.conf ]; then 5 | sed -i \ 6 | -e 's/services=.*/services=condure,pushpin-proxy,pushpin-handler/' \ 7 | -e 's/push_in_spec=.*/push_in_spec=tcp:\/\/\*:5560/' \ 8 | -e 's/push_in_http_addr=.*/push_in_http_addr=0.0.0.0/' \ 9 | -e 's/push_in_sub_specs=.*/push_in_sub_spec=tcp:\/\/\*:5562/' \ 10 | -e 's/command_spec=.*/command_spec=tcp:\/\/\*:5563/' \ 11 | -e 's/^http_port=.*/http_port=7999/' \ 12 | /etc/pushpin/pushpin.conf 13 | else 14 | echo "docker-entrypoint.sh: unable to write to /etc/pushpin/pushpin.conf, readonly" 15 | fi 16 | 17 | # Set routes with ${target} for backwards-compatibility. 18 | if [ -v target ]; then 19 | echo "* ${target},over_http" > /etc/pushpin/routes 20 | fi 21 | 22 | exec "$@" 23 | --------------------------------------------------------------------------------