Skip to content

Commit

Permalink
Switch final containers to use base image
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorodskyi committed Feb 8, 2024
1 parent 45f06c7 commit e7ed6db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 40 deletions.
11 changes: 1 addition & 10 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
FROM registry.suse.com/bci/python:3.11

# We do the whole installation and configuration in one layer:
COPY requirements.txt /pcw/
# * Install system requirements
# * Install pip requirements
# * Empty system cache to conserve some space
RUN source /etc/os-release && zypper addrepo -G -cf "https://download.opensuse.org/repositories/SUSE:/CA/$VERSION_ID/SUSE:CA.repo" && \
zypper -n in ca-certificates-suse gcc libffi-devel && \
pip install --no-cache-dir wheel && pip install --no-cache-dir -r /pcw/requirements.txt && zypper clean && rm -rf /var/cache
FROM ghcr.io/suse/pcw_base_main:latest

Check failure on line 1 in containers/Dockerfile

View workflow job for this annotation

GitHub Actions / hadolint

DL3007 warning: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

# Copy program files only
COPY ocw /pcw/ocw/
Expand Down
9 changes: 1 addition & 8 deletions containers/Dockerfile_dev
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
FROM registry.suse.com/bci/python:3.11
FROM ghcr.io/suse/pcw_base_main:latest

ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1
ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy

## System preparation steps ################################################# ##

RUN zypper -n in gcc libffi-devel && zypper clean && rm -rf /var/cache

COPY requirements.txt requirements_test.txt requirements_k8s.txt /tmp/
RUN pip install --no-cache-dir wheel && pip install --no-cache-dir -r /tmp/requirements_test.txt

WORKDIR /pcw

ENTRYPOINT ["sh", "-c"]
12 changes: 1 addition & 11 deletions containers/Dockerfile_k8s
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
FROM registry.suse.com/bci/python:3.11

RUN zypper -n in gcc tar gzip kubernetes1.24-client aws-cli && zypper clean && rm -rf /var/cache

# Google cli installation
RUN curl -sf https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-415.0.0-linux-x86_64.tar.gz | tar -zxf - -C /opt \
&& /opt/google-cloud-sdk/bin/gcloud components install gke-gcloud-auth-plugin

# Install python dependences
COPY requirements_k8s.txt /pcw/
RUN pip install --no-cache-dir wheel && pip install --no-cache-dir -r /pcw/requirements_k8s.txt
FROM ghcr.io/suse/pcw_base_k8s:latest

# Copy program files only
COPY ocw /pcw/ocw/
Expand Down
12 changes: 1 addition & 11 deletions containers/Dockerfile_k8s_dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
FROM registry.suse.com/bci/python:3.11

RUN zypper -n in gcc tar gzip kubernetes1.24-client aws-cli azure-cli && zypper clean && rm -rf /var/cache

# Google cli installation
RUN curl -s https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-415.0.0-linux-x86_64.tar.gz | tar -zxf - -C /opt \
&& /opt/google-cloud-sdk/bin/gcloud components install gke-gcloud-auth-plugin

# Install python dependences
COPY requirements_k8s.txt requirements.txt requirements_test.txt /pcw/
RUN pip install --no-cache-dir wheel && pip install --no-cache-dir -r /pcw/requirements_k8s.txt
FROM ghcr.io/suse/pcw_base_k8s:latest

ENV PATH ${PATH}:/opt/google-cloud-sdk/bin/

Expand Down

0 comments on commit e7ed6db

Please sign in to comment.