File tree Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -24,22 +24,24 @@ jobs:
2424 uses : docker/setup-buildx-action@v3
2525
2626 - name : Login to Docker Hub
27- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
27+ uses : docker/login-action@v3
2828 with :
2929 username : ${{ secrets.DOCKERHUB_USERNAME }}
3030 password : ${{ secrets.DOCKERHUB_TOKEN }}
3131
3232 - name : Extract metadata (tags, labels) for Docker
3333 id : meta
34- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
34+ uses : docker/metadata-action@v5
3535 with :
3636 images : parseable/parseable
3737
3838 - name : Build and push
39- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
39+ uses : docker/build-push-action@v6
4040 with :
4141 context : .
4242 file : ./Dockerfile.debug
4343 push : true
4444 tags : parseable/parseable:edge-debug
4545 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:
2424 uses : docker/setup-buildx-action@v3
2525
2626 - name : Login to Docker Hub
27- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
27+ uses : docker/login-action@v3
2828 with :
2929 username : ${{ secrets.DOCKERHUB_USERNAME }}
3030 password : ${{ secrets.DOCKERHUB_TOKEN }}
3131
3232 - name : Extract metadata (tags, labels) for Docker
3333 id : meta
34- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
34+ uses : docker/metadata-action@v5
3535 with :
3636 images : parseable/parseable
3737
3838 - name : Build and push
39- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
39+ uses : docker/build-push-action@v6
4040 with :
4141 context : .
4242 file : ./Dockerfile
4343 push : true
4444 tags : parseable/parseable:edge
4545 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 1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
1616# build stage
17- FROM rust:1.83.0-bookworm as builder
17+ FROM rust:1.83.0-bookworm AS builder
1818
1919LABEL org.opencontainers.image.title="Parseable"
2020LABEL maintainer=
"Parseable Team <[email protected] >" 2121LABEL org.opencontainers.image.vendor="Parseable Inc"
2222LABEL org.opencontainers.image.licenses="AGPL-3.0"
2323
2424WORKDIR /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
2632RUN cargo build --release
2733
2834# final stage
2935FROM gcr.io/distroless/cc-debian12:latest
3036
3137WORKDIR /parseable
3238
33- # Copy the static shell into base image.
39+ # Copy the static binary into the final image
3440COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable
3541
3642CMD ["/usr/bin/parseable" ]
Original file line number Diff line number Diff line change @@ -22,14 +22,21 @@ LABEL org.opencontainers.image.vendor="Parseable Inc"
2222LABEL org.opencontainers.image.licenses="AGPL-3.0"
2323
2424WORKDIR /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
2632RUN cargo build
2733
2834# final stage
2935FROM docker.io/debian:bookworm-slim
3036
3137WORKDIR /parseable
3238
39+ # Copy the static binary into the final image
3340COPY --from=builder /parseable/target/debug/parseable /usr/bin/parseable
3441
3542CMD ["/usr/bin/parseable"]
You can’t perform that action at this time.
0 commit comments