简体   繁体   中英

Dockerfile for Appium Robot Framework

I am trying to create a dockerfile for a simple mobile test script I tried my hands on in robot framework. below is the Dockerfile I created. The build has not been successful, I need help in getting it right

FROM python:3
MAINTAINER  Ademola Bhadmus, bhadmusademola.1@gmail.com
ENV env=/root/env
ENV PATH="$env/bin:$PATH"
WORKDIR  /root
# Copy relevant files to work directory
COPY Resources .
COPY Results .
COPY Tests .
# Install Python, Robot, and Appium
COPY requirements.txt .
RUN pip3 install --no-cache-dir --upgrade pip
RUN python3 -m venv $env
RUN pip3 install --no-cache-dir -r requirements.txt
FROM node:latest
RUN mkdir -p /usr/app
WORKDIR /usr/app
COPY . .
RUN npm install -g appium
# Execute file
CMD ["appium"]
CMD ["robot", "-d", "results", "index.robot"]

I got this error

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-01-01T06_52_36_641Z-debug.log
What am I doing wrong? (edited) 

Please what am I doing wrong?

FROM node:lts
RUN npm -v
RUN node -v
#RUN npm install -g appium --chromedriver-skip-install
RUN npm install -g appium --unsafe-perm=true --allow-root

# Execute file
CMD ["appium"]
CMD ["robot", "-d", "results", "index.robot"]

the latest version is node 15 and has npm version 7+ which is not supported as of now, use node lts.

Also you have to use skip chrome driver installation and copy it with additional step due to permission error

else you can pass --unsafe-perm=true --allow-root as added in docker file to install it through script itself

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM