fix build and set entrypoint

This commit is contained in:
naskya 2024-07-02 00:48:30 +09:00
parent def84c5c4d
commit 7eb631b3fb
Signed by: naskya
GPG key ID: 712D413B3A9FED5C
5 changed files with 25 additions and 8 deletions

11
Cargo.lock generated
View file

@ -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",
]

View file

@ -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

View file

@ -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"]

View file

@ -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`.

View file

@ -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"] }