4 Commits

Author SHA1 Message Date
Eric Zhang
634af3f6af Fix CI Docker build and bump version to 0.2.3 2022-04-10 23:27:26 -04:00
Eric Zhang
f6bd20a508 Edit README and bump version to 0.2.2 2022-04-10 23:20:23 -04:00
Jihchi Lee
c154a846f6 Add a Dockerfile for building a container image (#8)
* Add a Dockerfile

* Reduce image size from ~75MB to ~6MB

* Add Dockerignore and README documentation

* Add Docker build action to CI

Co-authored-by: Eric Zhang <ekzhang1@gmail.com>
2022-04-10 23:15:15 -04:00
Ariz Zubair
d4e7c42949 Minor grammar fix. (#5) 2022-04-10 14:28:42 -04:00
6 changed files with 79 additions and 5 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
/target

49
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Docker
on:
push:
tags:
- "v*.*.*"
jobs:
build_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ekzhang/bore
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

2
Cargo.lock generated
View File

@@ -84,7 +84,7 @@ dependencies = [
[[package]]
name = "bore-cli"
version = "0.2.1"
version = "0.2.3"
dependencies = [
"anyhow",
"clap",

View File

@@ -1,6 +1,6 @@
[package]
name = "bore-cli"
version = "0.2.1"
version = "0.2.3"
authors = ["Eric Zhang <ekzhang1@gmail.com>"]
license = "MIT"
description = "A modern, simple TCP tunnel in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls."

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM rust:alpine as builder
WORKDIR /home/rust/src
RUN apk --no-cache add musl-dev
COPY . .
RUN cargo install --path .
FROM scratch
COPY --from=builder /usr/local/cargo/bin/bore .
USER 1000:1000
ENTRYPOINT ["./bore"]

View File

@@ -21,6 +21,20 @@ Similar to [localtunnel](https://github.com/localtunnel/localtunnel) and [ngrok]
(`bore` totals less than 400 lines of safe, async Rust code and is trivial to set up — just run a single binary for the client and server.)
## Installation
You can build the `bore` CLI command from source using [Cargo](https://doc.rust-lang.org/cargo/), the Rust package manager. This command installs the `bore` binary at a user-accessible path.
```shell
cargo install bore-cli
```
We also publish versioned Docker images for each release. Each image is built for AMD 64-bit and Arm 64-bit architectures. They're tagged with the specific version and allow you to run the statically-linked `bore` binary from a minimal "scratch" container.
```shell
docker run -it --init --rm --network host ekzhang/bore <ARGS>
```
## Detailed Usage
This section describes detailed usage for the `bore` CLI command.
@@ -38,7 +52,7 @@ You can optionally pass in a `--port` option to pick a specific port on the remo
The full options are shown below.
```shell
bore-local 0.2.1
bore-local 0.2.3
Starts a local proxy to the remote server
USAGE:
@@ -57,7 +71,7 @@ OPTIONS:
### Self-Hosting
As mentioned in the startup instructions, there is an public instance of the `bore` server running at `bore.pub`. However, if you want to self-host `bore` on your own network, you can do so with the following command:
As mentioned in the startup instructions, there is a public instance of the `bore` server running at `bore.pub`. However, if you want to self-host `bore` on your own network, you can do so with the following command:
```shell
bore server
@@ -68,7 +82,7 @@ That's all it takes! After the server starts running at a given address, you can
The full options for the `bore server` command are shown below.
```shell
bore-server 0.2.1
bore-server 0.2.3
Runs the remote proxy server
USAGE: