From 7eb631b3fb15cb6073fe46d422bbee1ea7f41fd5 Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 2 Jul 2024 00:48:30 +0900 Subject: [PATCH] fix build and set entrypoint --- Cargo.lock | 11 +++++++++++ Cargo.toml | 4 ++++ Containerfile | 9 +++++---- docs/install.md | 6 ++---- fishctl/Cargo.toml | 3 +++ 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fd6c2d..c205b65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,6 +538,7 @@ dependencies = [ "emojis", "enum-iterator", "macros", + "openssl", "redis", "serde", "serde_repr", @@ -1058,6 +1059,15 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.102" @@ -1066,6 +1076,7 @@ checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 6e2d195..a8475c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["fishctl", "macros"] +default-members = ["fishctl"] resolver = "2" [workspace.dependencies] @@ -24,5 +25,8 @@ vapid = "0.6.0" validator = "0.18.1" yaml-rust = "0.4.5" +# subdependency +openssl = "0.10.64" + [profile.release] lto = true diff --git a/Containerfile b/Containerfile index 26b7683..c3514cb 100644 --- a/Containerfile +++ b/Containerfile @@ -1,10 +1,11 @@ FROM docker.io/rust:alpine AS builder -WORKDIR /fishctl +WORKDIR /repository COPY . . -RUN apk add --no-cache musl-dev -RUN cargo install --locked --path . +RUN apk add --no-cache musl-dev build-base perl +RUN cargo install --locked --path fishctl FROM docker.io/busybox:musl -COPY README.md LICENSE-APACHE LICENSE-MIT ./ +COPY README.md LICENSE-APACHE LICENSE-MIT . COPY --from=builder /usr/local/cargo/bin/fishctl /usr/local/bin/fishctl WORKDIR /firefish +ENTRYPOINT ["fishctl"] diff --git a/docs/install.md b/docs/install.md index 5cffa41..599e459 100644 --- a/docs/install.md +++ b/docs/install.md @@ -42,14 +42,12 @@ Using the `registry.firefish.dev/firefish/fishctl` container image, `fishctl ___ # (i.e., the Firefish local repository directory) docker run -it --rm --volume "$(pwd)":/firefish --network network_name \ - registry.firefish.dev/firefish/fishctl \ - fishctl ___ + registry.firefish.dev/firefish/fishctl ___ # or podman run -it --rm --volume "$(pwd)":/firefish --network network_name \ - registry.firefish.dev/firefish/fishctl \ - fishctl ___ + registry.firefish.dev/firefish/fishctl ___ ``` Where `network_name` is the network name on which the database is running. If you want to use this for the host network (i.e., use the container as if it were a locally installed command), you should replace `network_name` with `host`. diff --git a/fishctl/Cargo.toml b/fishctl/Cargo.toml index 4adfe62..1df00f1 100644 --- a/fishctl/Cargo.toml +++ b/fishctl/Cargo.toml @@ -25,3 +25,6 @@ url = { workspace = true } vapid = { workspace = true } validator = { workspace = true, features = ["derive"] } yaml-rust = { workspace = true } + +# subdependency +openssl = { workspace = true, features = ["vendored"] }