ppodgorsek / docker-robot-framework

Robot Framework in Docker
https://cloud.docker.com/repository/docker/ppodgorsek/robot-framework
MIT License
333 stars 235 forks source link

How to uninstall paramiko package and install specific version paramiko==1.18.5 package #424

Open dhingrachirag opened 1 year ago

dhingrachirag commented 1 year ago

Hi Hi I am facing below issue,

I am facing 1 issue where I am trying to uninstall paramiko package and install specific version paramiko==1.18.5 package.

I am using below docker file to execute:

FROM ppodgorsek/robot-framework:latest

USER root

## # Install system dependencies
RUN apk update \
   && apk --no-cache --virtual .build-deps add \
    gcc \
    g++ \
    libffi-dev \
    linux-headers \
    make \
    musl-dev \
    openssl-dev \
    which \
    wget \
    && \
#  Uninstall paramiko version
  pip3 uninstall parmiko \
    && \
# Install Robot Framework and specific paramiko version
  pip3 install \
    --no-cache-dir \
    -Iv paramiko==1.18.5 \
  && apk del --no-cache --update-cache .build-deps

USER ${ROBOT_UID}:${ROBOT_GID}

By using above docker image I am getting below error:

STEP 4: USER root
37848641cb590c96cb11fe6582a9931d00163e419bff12e42d0032d68d176f30
STEP 5: RUN apk update    && apk --no-cache --virtual .build-deps add     gcc     g++     libffi-dev     linux-headers     make     musl-dev     openssl-dev     which     wget     &&   pip3 uninstall parmiko     &&   pip3 install     --no-cache-dir     -Iv paramiko==1.18.5   && apk del --no-cache --update-cache .build-deps
cannot set HOME environment variable
/bin/sh: line 1: apk: command not found
Error: error building at STEP "RUN apk update    && apk --no-cache --virtual .build-deps add     gcc     g++     libffi-dev     linux-headers     make     musl-dev     openssl-dev     which     wget     &&   pip3 uninstall parmiko     &&   pip3 install     --no-cache-dir     -Iv paramiko==1.18.5   && apk del --no-cache --update-cache .build-deps": error while running runtime: exit status 127
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 125

Requesting you to please assist on this issue as struck in this from while.

cas-technology commented 10 months ago

The problem is that you are trying to use 'apk'. ppodgorsek/robot-framework is based on Fedora. You can use DNF.

Disclaimer: Untested, and I'm not too familiar with Fedora so use with caution.

FROM ppodgorsek/robot-framework:latest

USER root

## Install system dependencies
RUN dnf install -y \
    gcc \
    gcc-c++ \
    libffi-devel \
    glibc-headers \
    make \
    musl-devel \
    openssl-devel \
    which \
    wget \
    && \
# Uninstall paramiko version
    pip3 uninstall paramiko \
    && \
# Install Robot Framework and specific paramiko version
    pip3 install \
    --no-cache-dir \
    -Iv paramiko==1.18.5 \
    && dnf clean all

USER ${ROBOT_UID}:${ROBOT_GID}