Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Optimized Dockerfile for small image size #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions asciibinder/openshift-docs-build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
FROM ruby:3.1.2-alpine3.16 AS builder

RUN apk update && apk add --virtual build-dependencies build-base

RUN gem install listen asciidoctor asciidoctor-diagram ascii_binder
RUN apk update && apk add --no-cache --virtual build-dependencies build-base \
&& gem install listen asciidoctor asciidoctor-diagram ascii_binder \
&& apk del build-dependencies

FROM ruby:3.1.2-alpine3.16

COPY --from=builder /usr/local/bundle /usr/local/bundle

ENV PYTHONUNBUFFERED=1

RUN apk add --update --no-cache git bash python3 python3-dev && ln -sf python3 /usr/bin/python

RUN python3 -m ensurepip

RUN pip3 install --no-cache --upgrade pip setuptools

RUN apk add --update --no-cache git bash python3 python3-dev \
&& ln -sf python3 /usr/bin/python \
&& python3 -m ensurepip \
&& pip3 install --no-cache --upgrade pip setuptools \
&& rm -rf /var/cache/apk/*
WORKDIR /openshift-docs-build

COPY ./aura.tar.gz /openshift-docs-build

RUN pip3 install --no-cache-dir pyyaml aura.tar.gz
RUN pip3 install --no-cache-dir pyyaml aura.tar.gz \
&& git config --global --add safe.directory /openshift-docs-build