File tree 4 files changed +27
-10
lines changed
4 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,24 @@ jobs:
24
24
uses : docker/setup-buildx-action@v3
25
25
26
26
- name : Login to Docker Hub
27
- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
27
+ uses : docker/login-action@v3
28
28
with :
29
29
username : ${{ secrets.DOCKERHUB_USERNAME }}
30
30
password : ${{ secrets.DOCKERHUB_TOKEN }}
31
31
32
32
- name : Extract metadata (tags, labels) for Docker
33
33
id : meta
34
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
34
+ uses : docker/metadata-action@v5
35
35
with :
36
36
images : parseable/parseable
37
37
38
38
- name : Build and push
39
- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
39
+ uses : docker/build-push-action@v6
40
40
with :
41
41
context : .
42
42
file : ./Dockerfile.debug
43
43
push : true
44
44
tags : parseable/parseable:edge-debug
45
45
platforms : linux/amd64,linux/arm64
46
+ cache-from : type=gha
47
+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change @@ -24,22 +24,24 @@ jobs:
24
24
uses : docker/setup-buildx-action@v3
25
25
26
26
- name : Login to Docker Hub
27
- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
27
+ uses : docker/login-action@v3
28
28
with :
29
29
username : ${{ secrets.DOCKERHUB_USERNAME }}
30
30
password : ${{ secrets.DOCKERHUB_TOKEN }}
31
31
32
32
- name : Extract metadata (tags, labels) for Docker
33
33
id : meta
34
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
34
+ uses : docker/metadata-action@v5
35
35
with :
36
36
images : parseable/parseable
37
37
38
38
- name : Build and push
39
- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
39
+ uses : docker/build-push-action@v6
40
40
with :
41
41
context : .
42
42
file : ./Dockerfile
43
43
push : true
44
44
tags : parseable/parseable:edge
45
45
platforms : linux/amd64,linux/arm64
46
+ cache-from : type=gha
47
+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 14
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
16
16
# build stage
17
- FROM rust:1.83.0-bookworm as builder
17
+ FROM rust:1.83.0-bookworm AS builder
18
18
19
19
LABEL org.opencontainers.image.title="Parseable"
20
20
LABEL maintainer=
"Parseable Team <[email protected] >"
21
21
LABEL org.opencontainers.image.vendor="Parseable Inc"
22
22
LABEL org.opencontainers.image.licenses="AGPL-3.0"
23
23
24
24
WORKDIR /parseable
25
- COPY . .
25
+
26
+ # Cache dependencies
27
+ COPY Cargo.toml Cargo.lock build.rs .git ./
28
+ RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && rm -rf src
29
+
30
+ # Build the actual binary
31
+ COPY src ./src
26
32
RUN cargo build --release
27
33
28
34
# final stage
29
35
FROM gcr.io/distroless/cc-debian12:latest
30
36
31
37
WORKDIR /parseable
32
38
33
- # Copy the static shell into base image.
39
+ # Copy the static binary into the final image
34
40
COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable
35
41
36
42
CMD ["/usr/bin/parseable" ]
Original file line number Diff line number Diff line change @@ -22,14 +22,21 @@ LABEL org.opencontainers.image.vendor="Parseable Inc"
22
22
LABEL org.opencontainers.image.licenses="AGPL-3.0"
23
23
24
24
WORKDIR /parseable
25
- COPY . .
25
+
26
+ # Cache dependencies
27
+ COPY Cargo.toml Cargo.lock build.rs .git ./
28
+ RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release && rm -rf src
29
+
30
+ # Build the actual binary
31
+ COPY src ./src
26
32
RUN cargo build
27
33
28
34
# final stage
29
35
FROM docker.io/debian:bookworm-slim
30
36
31
37
WORKDIR /parseable
32
38
39
+ # Copy the static binary into the final image
33
40
COPY --from=builder /parseable/target/debug/parseable /usr/bin/parseable
34
41
35
42
CMD ["/usr/bin/parseable"]
You can’t perform that action at this time.
0 commit comments