Skip to content

Commit effb589

Browse files
committed
fix(docker): Docker entrypoint and optimize CLI size (#301)
* build: Optimize CLI size * fix: Docker image
1 parent 9d9a1a6 commit effb589

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ httptest = "0.16.1"
5353
lazy_static = "1.5.0"
5454
predicates = "3.1.2"
5555
pretty_assertions_sorted = "1.2.3"
56+
57+
[profile.release]
58+
# source: https://lafor.ge/http-smol/#rust
59+
strip = true
60+
opt-level = "z"
61+
lto = true
62+
codegen-units = 1
63+
panic = "abort"

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ ARG TARGETPLATFORM
88
WORKDIR /app
99
COPY \
1010
--chown=1000:1000 \
11+
--chmod=555 \
1112
--link \
12-
"builds/${TARGETPLATFORM}/dofigen" "/bin/"
13+
"builds/${TARGETPLATFORM}/dofigen" "/bin/dofigen"
1314
USER 1000:1000
14-
ENTRYPOINT ["dofigen"]
15+
ENTRYPOINT ["/bin/dofigen"]
1516
CMD ["--help"]

dofigen.lock

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@ effective: |
77
copy:
88
- paths:
99
- builds/${TARGETPLATFORM}/dofigen
10-
target: /bin/
10+
target: /bin/dofigen
11+
chmod: '555'
1112
entrypoint:
12-
- dofigen
13+
- /bin/dofigen
1314
cmd:
1415
- --help
1516
images: {}
1617
resources:
1718
dofigen.yml:
18-
hash: 160f8547a6b42e0996778ad72c6a73328f8460e826475def77213acb69f45284
19+
hash: 07744cc5d5e65e7ebf07298fca4f239bf7296f9109c0fb60b177236291ccf61c
1920
content: |
2021
# Runtime
2122
workdir: /app
23+
# volume: /app
2224
arg:
2325
TARGETPLATFORM: ""
2426
copy:
2527
- paths: builds/${TARGETPLATFORM}/dofigen
26-
target: /bin/
27-
entrypoint: dofigen
28+
target: /bin/dofigen
29+
chmod: "555"
30+
entrypoint: /bin/dofigen
2831
cmd: --help
2932
context:
3033
- "/builds"

dofigen.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Runtime
22
workdir: /app
3+
# volume: /app
34
arg:
45
TARGETPLATFORM: ""
56
copy:
67
- paths: builds/${TARGETPLATFORM}/dofigen
7-
target: /bin/
8+
target: /bin/dofigen
9+
chmod: "555"
810
entrypoint: /bin/dofigen
911
cmd: --help
1012
context:

0 commit comments

Comments
 (0)