I am trying to build a docker image from a shell script called "noreward-rl.sh" and a text file "requirements.txt" by running it in the build process. My question is in the last line.
code:
FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/St_Johns
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig python3-dev python3-venv make golang libjpeg-turbo8-dev gcc wget unzip git fceux virtualenv tmux
COPY . /
RUN mkdir n && pwd && ls && bash /noreward-rl.sh n
CMD python n/src/train.py -e mario
output:
l@l-Lenovo-Rescuer-15ISK:/media/l/DATA/i$ sudo docker build .
Sending build context to Docker daemon 8.192kB
Step 1/8 : FROM ubuntu
---> adafef2e596e
Step 2/8 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 5e067750bbad
Step 3/8 : ENV TZ=America/St_Johns
---> Using cache
---> 090b23f72589
Step 4/8 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
---> Using cache
---> 11c25147c7ea
Step 5/8 : RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig python3-dev python3-venv make golang libjpeg-turbo8-dev gcc wget unzip git fceux virtualenv tmux
---> Using cache
---> db82557e0bcb
Step 6/8 : COPY . /
---> Using cache
---> f5851903e214
Step 7/8 : RUN mkdir n && pwd && ls && bash /noreward-rl.sh n
---> Running in 4eb88abe9337
/
Dockerfile
bin
boot
dev
etc
home
lib
lib32
lib64
libx32
media
mnt
n
noreward-rl .sh
opt
proc
requirements.txt
root
run
sbin
srv
sys
tmp
usr
var
x
bash: /noreward-rl.sh: No such file or directory
The command '/bin/sh -c mkdir n && pwd && ls && bash /noreward-rl.sh n' returned a non-zero code: 127
Why is it telling me that noreward-rl.sh doesn't exist while "ls" command shows me that it is in the current directory? Why is there an extra space in the filename in output of ls command?
UPDATE: I changed "noreward-rl.sh" to "n.sh" and it works now. But I still wonder why it did that?
new code:
FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=America/St_Johns
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python-pip curl python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig python3-dev python3-venv make golang libjpeg-turbo8-dev gcc wget unzip git fceux virtualenv tmux
COPY . /
RUN mkdir n && pwd && ls && bash /n.sh n
CMD python n/src/train.py -e mario
new output:
l@l-Lenovo-Rescuer-15ISK:/media/l/DATA/i$ sudo docker build .
Sending build context to Docker daemon 8.192kB
Step 1/8 : FROM ubuntu
---> adafef2e596e
Step 2/8 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 5e067750bbad
Step 3/8 : ENV TZ=America/St_Johns
---> Using cache
---> 090b23f72589
Step 4/8 : RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
---> Using cache
---> 11c25147c7ea
Step 5/8 : RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python-pip curl python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig python3-dev python3-venv make golang libjpeg-turbo8-dev gcc wget unzip git fceux virtualenv tmux
---> Running in d392fffa2533
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [165 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [1078 B]
Get:6 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [33.9 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [45.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [4202 B]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [33.9 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [165 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [330 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [3209 B]
Fetched 14.2 MB in 3s (4596 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python-pip
The command '/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python-pip curl python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg xorg-dev python-opengl libboost-all-dev libsdl2-dev swig python3-dev python3-venv make golang libjpeg-turbo8-dev gcc wget unzip git fceux virtualenv tmux' returned a non-zero code: 100