Update to Edition 2021 and fix docker build

This commit is contained in:
Aram 🍐 2022-06-25 11:12:23 -04:00
parent 75bad318f4
commit 00b45f8cb4
4 changed files with 7 additions and 6 deletions

View file

@ -10,7 +10,7 @@ jobs:
matrix: matrix:
rust: rust:
- stable - stable
- 1.55.0 - 1.56.0
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -39,7 +39,7 @@ jobs:
matrix: matrix:
rust: rust:
- stable - stable
- 1.55.0 - 1.56.0
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -1,7 +1,7 @@
[package] [package]
name = "onetun" name = "onetun"
version = "0.3.1" version = "0.3.1"
edition = "2018" edition = "2021"
license = "MIT" license = "MIT"
description = "A cross-platform, user-space WireGuard port-forwarder that requires no system network configurations." description = "A cross-platform, user-space WireGuard port-forwarder that requires no system network configurations."
authors = ["Aram Peres <aram.peres@gmail.com>"] authors = ["Aram Peres <aram.peres@gmail.com>"]

View file

@ -1,10 +1,11 @@
FROM rust:1.55 as cargo-build FROM rust:1.56 as cargo-build
WORKDIR /usr/src/onetun WORKDIR /usr/src/onetun
COPY Cargo.toml Cargo.toml COPY Cargo.toml Cargo.toml
# Placeholder to download dependencies and cache them using layering # Placeholder to download dependencies and cache them using layering
RUN mkdir src/ RUN mkdir src/
RUN touch src/lib.rs
RUN echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs RUN echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs
RUN cargo build --release RUN cargo build --release
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/myapp* RUN rm -f target/x86_64-unknown-linux-musl/release/deps/myapp*

View file

@ -21,7 +21,7 @@ For example,
## Download ## Download
onetun is available to install from [crates.io](https://crates.io/crates/onetun) with Rust ≥1.55: onetun is available to install from [crates.io](https://crates.io/crates/onetun) with Rust ≥1.56:
```shell ```shell
$ cargo install onetun $ cargo install onetun
@ -37,7 +37,7 @@ $ docker run --rm --name onetun --user 1000 -p 8080:8080 aramperes/onetun \
0.0.0.0:8080:192.168.4.2:8080 [...options...] 0.0.0.0:8080:192.168.4.2:8080 [...options...]
``` ```
You can also build onetun locally, using Rust ≥1.55: You can also build onetun locally, using Rust ≥1.56:
```shell ```shell
$ git clone https://github.com/aramperes/onetun && cd onetun $ git clone https://github.com/aramperes/onetun && cd onetun