From b6d60d89ab405c975fc293fea96f7f8c5ce9391f Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 5 Feb 2024 16:26:50 +0000 Subject: [PATCH] build: update docker example to bookworm --- docker/Cargo.toml | 7 ++++--- docker/Dockerfile | 4 ++-- docker/{README.MD => README.md} | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) rename docker/{README.MD => README.md} (55%) diff --git a/docker/Cargo.toml b/docker/Cargo.toml index 7ac9496..354927e 100644 --- a/docker/Cargo.toml +++ b/docker/Cargo.toml @@ -3,7 +3,8 @@ name = "docker_sample" version = "1.0.0" edition = "2021" +# Do not use workspace deps as they won't work in docker context. [dependencies] -actix-web.workspace = true -env_logger.workspace = true -log.workspace = true +actix-web = "4" +env_logger = "0.11" +log = "0.4" diff --git a/docker/Dockerfile b/docker/Dockerfile index 54310f0..b613ad3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ ################# ## build stage ## ################# -FROM rust:1-slim-bullseye AS builder +FROM rust:1-slim-bookworm AS builder WORKDIR /code # Download crates-io index and fetch dependency code. @@ -22,7 +22,7 @@ RUN cargo build --release ############### ## run stage ## ############### -FROM debian:bullseye-slim +FROM bitnami/minideb:bookworm WORKDIR /app # copy server binary from build stage diff --git a/docker/README.MD b/docker/README.md similarity index 55% rename from docker/README.MD rename to docker/README.md index 187d4c2..4666b90 100644 --- a/docker/README.MD +++ b/docker/README.md @@ -3,13 +3,13 @@ ## Build image ```shell -docker build -t docker_sample . +docker build -t actix-docker . ``` ## Run built image ```shell -docker run -d -p 8080:8080 docker_sample +docker run -d -p 8080:8080 actix-docker # and the server should start instantly curl http://localhost:8080 ``` @@ -17,6 +17,6 @@ curl http://localhost:8080 ## Running unit tests ```shell -docker build -t docker_sample:test . -docker run --rm docker_sample:test +docker build -t actix-docker:test . +docker run --rm actix-docker:test ```