diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 540c2ede1c..0000000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -docker -target \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b50e7406c..c4df22395c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,60 +298,6 @@ jobs: sim_paths: "sims/iroh/iroh.json,sims/integration" pr_number: ${{ github.event.pull_request.number || '' }} - docker_build_and_test: - name: Docker Test - if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')" - timeout-minutes: 30 - runs-on: [self-hosted, linux, X64] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.6 - - - name: Prep - run: sudo apt-get install musl-tools -y - - - name: Build iroh - run: cargo build --profile=dev-ci --all-features --bin iroh --target x86_64-unknown-linux-musl - - - name: Prep bins - run: | - mkdir -p bins/linux/amd64 - cp target/x86_64-unknown-linux-musl/dev-ci/iroh bins/linux/amd64/iroh - - - name: Cleanup Docker - continue-on-error: true - run: | - docker kill $(docker ps -q) - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: false - load: true - tags: n0computer/iroh-test:latest - target: iroh - platforms: linux/amd64 - file: docker/Dockerfile.ci - - - name: Run Docker image & stats test - run: | - docker run -p 9090:9090 -p 4919:4919/udp -Pd n0computer/iroh-test:latest --rpc-addr 0.0.0.0:4919 start - # Give the server time to start - sleep 3 - target/x86_64-unknown-linux-musl/dev-ci/iroh --rpc-addr 127.0.0.1:4919 stats - codespell: timeout-minutes: 30 runs-on: ubuntu-latest diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 0216b7e25a..0000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,115 +0,0 @@ -name: Docker - -on: - workflow_dispatch: - inputs: - release_version: - description: "Release version" - required: true - type: string - default: "" - base_hash: - description: "Commit hash from which to build" - required: true - type: string - default: "" - publish: - description: "Publish to Docker Hub" - required: true - type: boolean - default: false - workflow_call: - inputs: - release_version: - description: "Release version" - required: true - type: string - default: "" - base_hash: - description: "Commit hash from which to build" - required: true - type: string - default: "" - publish: - description: "Publish to Docker Hub" - required: true - type: boolean - default: false - -env: - IROH_FORCE_STAGING_RELAYS: "1" - -jobs: - build_and_publish: - timeout-minutes: 30 - name: Docker - runs-on: [self-hosted, linux, X64] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Prep dirs - run: | - mkdir -p bins/linux/amd64 - mkdir -p bins/linux/arm64 - - - name: Setup awscli on linux - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip awscliv2.zip - sudo ./aws/install --update - - - name: Set aws credentials - run: | - echo "AWS_ACCESS_KEY_ID=${{secrets.S3_ACCESS_KEY_ID}}" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=${{secrets.S3_ACCESS_KEY}}" >> $GITHUB_ENV - echo "AWS_DEFAULT_REGION=us-west-2" >> $GITHUB_ENV - - - name: Fetch release binaries - run: | - aws s3 cp s3://vorc/iroh-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh - aws s3 cp s3://vorc/iroh-relay-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-relay - aws s3 cp s3://vorc/iroh-dns-server-linux-amd64-${{ inputs.base_hash }} bins/linux/amd64/iroh-dns-server - - aws s3 cp s3://vorc/iroh-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh - aws s3 cp s3://vorc/iroh-relay-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-relay - aws s3 cp s3://vorc/iroh-dns-server-linux-aarch64-${{ inputs.base_hash }} bins/linux/arm64/iroh-dns-server - - - name: Build Docker image (iroh) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh:latest,n0computer/iroh:${{ inputs.release_version }} - target: iroh - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci - - - name: Build Docker image (iroh-relay) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ inputs.release_version }} - target: iroh-relay - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci - - - name: Build Docker image (iroh-dns-server) - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ inputs.publish }} - tags: n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ inputs.release_version }} - target: iroh-dns-server - platforms: linux/amd64,linux/arm64/v8 - file: docker/Dockerfile.ci \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 016f0103b2..0000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -FROM rust:alpine AS chef - -RUN update-ca-certificates -RUN apk add --no-cache musl-dev openssl-dev pkgconfig -RUN cargo install cargo-chef -WORKDIR /iroh - -FROM chef AS planner -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -### Builder image -FROM chef AS rust_builder - -RUN update-ca-certificates -RUN apk add --no-cache musl-dev openssl-dev pkgconfig - -COPY --from=planner /iroh/recipe.json recipe.json -# Build dependencies - this is the caching Docker layer! -RUN cargo chef cook --release --recipe-path recipe.json - -WORKDIR /iroh - -# copy entire workspace -COPY . . - -RUN cargo build --release --all-features - -### Target image -FROM alpine:latest AS iroh - -RUN apk update && apk add ca-certificates && update-ca-certificates - -# Copy our build, changing owndership to distroless-provided "nonroot" user, -# (65532:65532) -COPY --from=rust_builder /iroh/target/release/iroh /iroh - -RUN chmod +x /iroh - -WORKDIR / - -# expose the default ports -# rpc, nat-pmp, metrics, iroh_node_ipv4, iroh_node_ipv6 -EXPOSE 4919/udp 5351 9090 11204/udp 11205/udp -ENTRYPOINT ["/iroh"] -CMD ["start"] - -### Target image -FROM alpine:latest AS iroh-relay - -RUN apk update && apk add ca-certificates && update-ca-certificates - -# Copy our build, changing owndership to distroless-provided "nonroot" user, -# (65532:65532) -COPY --from=rust_builder /iroh/target/release/iroh-relay /iroh-relay - -RUN chmod +x /iroh-relay - -WORKDIR / - -# expose the default ports -# http, https, stun, metrics -EXPOSE 80 443 3478/udp 9090 -ENTRYPOINT ["/iroh-relay"] -CMD [""] - -### Target image -FROM alpine:latest AS iroh-dns-server - -RUN apk update && apk add ca-certificates && update-ca-certificates - -# Copy our build, changing owndership to distroless-provided "nonroot" user, -# (65532:65532) -COPY --from=rust_builder /iroh/target/release/iroh-dns-server /iroh-dns-server - -RUN chmod +x /iroh-dns-server - -WORKDIR / - -# expose the default ports -# dns, metrics -EXPOSE 53/udp 9090 -ENTRYPOINT ["/iroh-dns-server"] -CMD [""] \ No newline at end of file diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci deleted file mode 100644 index 29384bad72..0000000000 --- a/docker/Dockerfile.ci +++ /dev/null @@ -1,52 +0,0 @@ -### Base image for iroh-relay and iroh-dns-server -FROM alpine:latest AS base -RUN apk update && apk add ca-certificates && update-ca-certificates - - -### Target image -FROM base AS iroh -ARG TARGETPLATFORM - -COPY bins/${TARGETPLATFORM}/iroh /iroh - -RUN chmod +x /iroh - -WORKDIR / - -# expose the default ports -# rpc, nat-pmp, metrics, iroh_node_ipv4, iroh_node_ipv6 -EXPOSE 4919/udp 5351 9090 11204/udp 11205/udp -ENTRYPOINT ["/iroh"] -CMD ["start"] - -### Target image -FROM base AS iroh-relay -ARG TARGETPLATFORM - -COPY bins/${TARGETPLATFORM}/iroh-relay /iroh-relay - -RUN chmod +x /iroh-relay - -WORKDIR / - -# expose the default ports -# http, https, stun, metrics -EXPOSE 80 443 3478/udp 9090 -ENTRYPOINT ["/iroh-relay"] -CMD [""] - -### Target image -FROM base AS iroh-dns-server -ARG TARGETPLATFORM - -COPY bins/${TARGETPLATFORM}/iroh-dns-server /iroh-dns-server - -RUN chmod +x /iroh-dns-server - -WORKDIR / - -# expose the default ports -# dns, metrics -EXPOSE 53/udp 9090 -ENTRYPOINT ["/iroh-dns-server"] -CMD [""] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 0dd0f53239..0000000000 --- a/docker/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Iroh Docker Images - -## Intro - -A set of docker images provided to easily run iroh in a containerized environment. -Features `iroh`, `iroh-relay` and `iroh-dns-server`. - -The provided `Docker` files are intended for CI use but can be also manually built. - -## Building - -- All commands are run from the root folder -- If you're on macOS run `docker buildx build -f docker/Dockerfile --target iroh --platform linux/arm64/v8 --tag n0computer/iroh:latest .` -- If you're on linux run `docker buildx build -f docker/Dockerfile --target iroh --platform linux/amd64 --tag n0computer/iroh:latest .` -- Switch out `--target iroh` for other targets `iroh-relay,iroh-dns-server` - -## Running - -### iroh - -- As is: `docker run -p 9090:9090 -p 4919:4919/udp -Pit n0computer/iroh:latest --rpc-addr 0.0.0.0:4919` -- With parameters: `docker run -p 9090:9090 -p 4919:4919/udp -Pit n0computer/iroh:latest --rpc-addr 0.0.0.0:4919 ` -- Provide a config file: `docker run -v ./docker.iroh.cfg:/iroh.cfg -p 9090:9090 -p 4919:4919/udp -Pit n0computer/iroh:latest --rpc-addr 0.0.0.0:4919 --config iroh.cfg start` - -### iroh-relay - -- Provide a config file: `docker run -v /path/to/iroh-relay.conf:/config/iroh-relay.conf -p 80:80 -p 443:443 -p 3478:3478/udp -p 9090:9090 -it n0computer/iroh-relay:latest --config /config/iroh-relay.conf` - -### iroh-dns-server - -- Provide a config file: `docker run -v /path/to/iroh-dns-server.conf:/config/iroh-dns-server.conf -p 53:53/udp -p 9090:9090 -it n0computer/iroh-dns-server:latest --config /config/iroh-dns-server.conf` \ No newline at end of file