Skip to main content
Rollback to Revision 3
Source Link
pacmaninbw
  • 26.1k
  • 13
  • 47
  • 114
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Approach 1 to install Python
# RUN mkdir /python && cd /python && \
#         wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz && \
#        tar -zxvf Python-3.11.1.tgz && \
#        cd Python-3.11.1 && \
#        ls -lhR && \
#        ./configure --enable-optimizations && \
#        make install && \
#        rm -rf /python
# Approach 1 end 

# Approach 2 to install python
# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version
# Approach 2 end

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Approach 1 to install Python
# RUN mkdir /python && cd /python && \
#         wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz && \
#        tar -zxvf Python-3.11.1.tgz && \
#        cd Python-3.11.1 && \
#        ls -lhR && \
#        ./configure --enable-optimizations && \
#        make install && \
#        rm -rf /python
# Approach 1 end 

# Approach 2 to install python
# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version
# Approach 2 end

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
added 476 characters in body
Source Link
shaik moeed
  • 233
  • 1
  • 10
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Approach 1 to install Python
# RUN mkdir /python && cd /python && \
#         wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz && \
#        tar -zxvf Python-3.11.1.tgz && \
#        cd Python-3.11.1 && \
#        ls -lhR && \
#        ./configure --enable-optimizations && \
#        make install && \
#        rm -rf /python
# Approach 1 end 

# Approach 2 to install python
# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version
# Approach 2 end

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Approach 1 to install Python
# RUN mkdir /python && cd /python && \
#         wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz && \
#        tar -zxvf Python-3.11.1.tgz && \
#        cd Python-3.11.1 && \
#        ls -lhR && \
#        ./configure --enable-optimizations && \
#        make install && \
#        rm -rf /python
# Approach 1 end 

# Approach 2 to install python
# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version
# Approach 2 end

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
Became Hot Network Question
deleted 4 characters in body
Source Link
shaik moeed
  • 233
  • 1
  • 10
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# # Set the LD_LIBRARY_PATH to include the copied shared libraries
# ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version

# is this step really necessary? there shouldn't be anything in /tmp
RUN find /tmp -name \*.deb -exec rm {} +

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# # Set the LD_LIBRARY_PATH to include the copied shared libraries
# ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version

# is this step really necessary? there shouldn't be anything in /tmp
RUN find /tmp -name \*.deb -exec rm {} +

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
FROM --platform=linux/amd64 ubuntu:22.04 as base

USER root

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive

COPY . /app
WORKDIR /app

COPY ZscalerRootCertificate-2048-SHA256.crt /usr/local/share/ca-certificates/ZscalerRootCertificate-2048-SHA256.crt

# Copy Python binaries from the GitHub Actions workflow
COPY Python /opt/Python

# Update PATH to include the copied Python binaries
ENV PATH="/opt/Python/3.11.1/x64/bin:/opt/Python/3.11.1/x64:${PATH}"

# Set the LD_LIBRARY_PATH to include the copied shared libraries
ENV LD_LIBRARY_PATH="/opt/python/lib:${LD_LIBRARY_PATH}"

# Fail soon than later, if python wasn't installed
RUN python --version

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y software-properties-common ca-certificates && \
    update-ca-certificates


RUN python -m pip install -U pip

RUN python3.11 -m pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements/core-requirements.txt
Post Reopened by Peilonrayz
I have embedded the code in my question
Added to review
Source Link
shaik moeed
  • 233
  • 1
  • 10
Loading
Post Closed as "Not suitable for this site" by Peilonrayz
Source Link
shaik moeed
  • 233
  • 1
  • 10
Loading