Skip to content

Commit

Permalink
build: update docker example to bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Feb 5, 2024
1 parent a46b707 commit b6d60d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions docker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docker/README.MD → docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
## 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
```

## 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
```

0 comments on commit b6d60d8

Please sign in to comment.