Skip to content

Commit af168cf

Browse files
author
Marek Suchánek
committed
Add a distro container configuration
1 parent 5bb0eb3 commit af168cf

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

Dockerfile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# See https://hub.docker.com/_/rust/
22

3-
## This configuration results in a large image with Rust tooling
4-
# FROM rust:1.44
5-
#
6-
# WORKDIR /usr/src/newdoc
7-
# COPY . .
8-
#
9-
# RUN cargo install --path .
10-
#
11-
# # CMD ["newdoc"]
12-
# ENTRYPOINT ["newdoc"]
3+
# This version of the container is distroless. It includes no package manager.
4+
# If you need to extend the functionality, use the container defined in
5+
# the Dockerfile-distro file.
136

147
FROM rust:latest as builder
158
WORKDIR /usr/src/newdoc

Dockerfile-distro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://hub.docker.com/_/rust/
2+
3+
# This version of the container includes a package manager,
4+
# if you need to extend the functionality in your workflow.
5+
6+
FROM rust:latest as builder
7+
WORKDIR /usr/src/newdoc
8+
COPY . .
9+
RUN cargo install --path .
10+
11+
FROM registry.access.redhat.com/ubi9-minimal:latest
12+
COPY --from=builder /usr/local/cargo/bin/newdoc /usr/local/bin/newdoc
13+
# When running this container interactively, use `-v .:/mnt/newdoc:Z`
14+
# to mount the current directory in the host to the container working dir.
15+
VOLUME ["/mnt/newdoc"]
16+
WORKDIR "/mnt/newdoc"
17+
CMD ["newdoc"]

0 commit comments

Comments
 (0)