Skip to content

Commit

Permalink
Update containerfiles (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm authored Jul 7, 2024
1 parent 9a69872 commit ad09682
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 99 deletions.
36 changes: 36 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM registry.access.redhat.com/ubi9/ubi as chef

RUN curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs > rustup-init.sh && \
sh rustup-init.sh --default-toolchain "1.79" --profile minimal -y && \
source "$HOME/.bashrc" && \
dnf install clang -y

ENV PATH="$PATH:/root/.cargo/bin"

RUN cargo install cargo-chef --locked --version "0.1.67" && \
rm -rf $CARGO_HOME/registry/



FROM chef AS planner
WORKDIR /planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json



FROM chef AS builder
WORKDIR /builder
COPY --from=planner /planner/recipe.json recipe.json
# Build dependencies
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --bin iam --release



FROM registry.access.redhat.com/ubi9/ubi-micro
WORKDIR /app
COPY --from=builder /builder/target/release/iam ./
CMD ["./iam"]
49 changes: 0 additions & 49 deletions Dockerfile

This file was deleted.

5 changes: 2 additions & 3 deletions docker-compose.yml → compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: '3'

services:
database:
image: mysql:8.0
image: docker.io/mysql:8.0
environment:
MYSQL_DATABASE: iam
MYSQL_USER: iam
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
TZ: Europe/Budapest
ports:
- "3306:3306"
36 changes: 36 additions & 0 deletions containerfiles/migration.Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM registry.access.redhat.com/ubi9/ubi as chef

RUN curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs > rustup-init.sh && \
sh rustup-init.sh --default-toolchain "1.79" --profile minimal -y && \
source "$HOME/.bashrc" && \
dnf install clang -y

ENV PATH="$PATH:/root/.cargo/bin"

RUN cargo install cargo-chef --locked --version "0.1.67" && \
rm -rf $CARGO_HOME/registry/



FROM chef AS planner
WORKDIR /planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json



FROM chef AS builder
WORKDIR /builder
COPY --from=planner /planner/recipe.json recipe.json
# Build dependencies
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --bin iam-migration --release



FROM registry.access.redhat.com/ubi9/ubi-micro
WORKDIR /app
COPY --from=builder /builder/target/release/iam-migration ./
CMD ["./iam-migration"]
47 changes: 0 additions & 47 deletions dockerfiles/migration.Dockerfile

This file was deleted.

0 comments on commit ad09682

Please sign in to comment.