Hi there,
I am having a problem with changing the order of RUN execution in the Dockerfile, which is not reflected in the results of the execution.
Please teach me what documents can be used as references and what keywords should be looked up?
ref: GitHub - hytdsh/my-open-interpreter: My Open Interpreter
The following writing works as expected.
...snip...
USER openint
WORKDIR /home/openint
RUN mkdir bin && bash -c '(echo && echo "PATH=\"$HOME/bin:$PATH\"")' >>${HOME}/.bashrc
COPY 3.5-turbo.py 3.5-turbo-16k.py 4.py 4-32k.py tokenizer.py bin/
RUN python -m venv python \
&& . python/bin/activate \
&& pip install \
google-search \
matplotlib \
numpy \
open-interpreter \
pandas \
tiktoken
RUN bash -c '(echo && echo "source ~/python/bin/activate")' >>${HOME}/.bashrc
~/work/open-interpreter$ docker compose build
~/work/open-interpreter$ docker compose up -d
~/work/open-interpreter$ docker compose exec openint bash
(python) openint@a18424c997a4:~$
(python) openint@a18424c997a4:~$ which python
/home/openint/python/bin/python
(python) openint@a18424c997a4:~$ which pip
/home/openint/python/bin/pip
(python) openint@a18424c997a4:~$ which interpreter
/home/openint/python/bin/interpreter
(python) openint@a18424c997a4:~$ pip list
Package Version
------------------ ------------
...snip...
open-interpreter 0.1.4
...snip...
(python) openint@a18424c997a4:~$ ls -la ~/python/bin
total 100
drwxr-xr-x 2 openint openint 4096 Sep 21 12:45 .
drwxr-xr-x 6 openint openint 4096 Sep 21 12:45 ..
-rw-r--r-- 1 openint openint 9033 Sep 21 12:44 Activate.ps1
-rw-r--r-- 1 openint openint 1991 Sep 21 12:44 activate
-rw-r--r-- 1 openint openint 917 Sep 21 12:44 activate.csh
-rw-r--r-- 1 openint openint 2197 Sep 21 12:44 activate.fish
-rwxr-xr-x 1 openint openint 227 Sep 21 12:45 dotenv
-rwxr-xr-x 1 openint openint 231 Sep 21 12:45 f2py
-rwxr-xr-x 1 openint openint 232 Sep 21 12:45 fonttools
-rwxr-xr-x 1 openint openint 228 Sep 21 12:45 gp
-rwxr-xr-x 1 openint openint 254 Sep 21 12:45 huggingface-cli
-rwxr-xr-x 1 openint openint 223 Sep 21 12:45 interpreter
-rwxr-xr-x 1 openint openint 235 Sep 21 12:45 markdown-it
-rwxr-xr-x 1 openint openint 259 Sep 21 12:45 normalizer
-rwxr-xr-x 1 openint openint 236 Sep 21 12:45 openai
-rwxr-xr-x 1 openint openint 236 Sep 21 12:44 pip
-rwxr-xr-x 1 openint openint 236 Sep 21 12:44 pip3
-rwxr-xr-x 1 openint openint 236 Sep 21 12:44 pip3.11
-rwxr-xr-x 1 openint openint 229 Sep 21 12:45 pyftmerge
-rwxr-xr-x 1 openint openint 230 Sep 21 12:45 pyftsubset
-rwxr-xr-x 1 openint openint 230 Sep 21 12:45 pygmentize
lrwxrwxrwx 1 openint openint 15 Sep 21 12:44 python -> /usr/bin/python
lrwxrwxrwx 1 openint openint 6 Sep 21 12:44 python3 -> python
lrwxrwxrwx 1 openint openint 6 Sep 21 12:44 python3.11 -> python
-rwxr-xr-x 1 openint openint 222 Sep 21 12:45 tqdm
-rwxr-xr-x 1 openint openint 227 Sep 21 12:45 ttx
The order of execution of RUN was swapped.
...snip...
USER openint
WORKDIR /home/openint
RUN python -m venv python \
&& . python/bin/activate \
&& pip install \
google-search \
matplotlib \
numpy \
open-interpreter \
pandas \
tiktoken
RUN bash -c '(echo && echo "source ~/python/bin/activate")' >>${HOME}/.bashrc
RUN mkdir bin && bash -c '(echo && echo "PATH=\"$HOME/bin:$PATH\"")' >>${HOME}/.bashrc
COPY 3.5-turbo.py 3.5-turbo-16k.py 4.py 4-32k.py tokenizer.py bin/
~/work/open-interpreter$ docker compose build
~/work/open-interpreter$ docker compose up -d
~/work/open-interpreter$ docker compose exec openint bash
(python) openint@99c95f53739a:~$
(python) openint@99c95f53739a:~$ which python
/usr/bin/python
(python) openint@99c95f53739a:~$ which pip
/usr/bin/pip
(python) openint@99c95f53739a:~$ which interpreter
(python) openint@99c95f53739a:~$
(python) openint@99c95f53739a:~$ pip list
Package Version
---------- -------
pip 23.0.1
setuptools 66.1.1
wheel 0.38.4
(python) openint@99c95f53739a:~$ ls -la ~/python/bin
total 100
drwxr-xr-x 2 openint openint 4096 Sep 21 09:32 .
drwxr-xr-x 6 openint openint 4096 Sep 21 09:32 ..
-rw-r--r-- 1 openint openint 9033 Sep 21 09:31 Activate.ps1
-rw-r--r-- 1 openint openint 1991 Sep 21 09:31 activate
-rw-r--r-- 1 openint openint 917 Sep 21 09:31 activate.csh
-rw-r--r-- 1 openint openint 2197 Sep 21 09:31 activate.fish
-rwxr-xr-x 1 openint openint 227 Sep 21 09:32 dotenv
-rwxr-xr-x 1 openint openint 231 Sep 21 09:32 f2py
-rwxr-xr-x 1 openint openint 232 Sep 21 09:32 fonttools
-rwxr-xr-x 1 openint openint 228 Sep 21 09:32 gp
-rwxr-xr-x 1 openint openint 254 Sep 21 09:32 huggingface-cli
-rwxr-xr-x 1 openint openint 223 Sep 21 09:32 interpreter
-rwxr-xr-x 1 openint openint 235 Sep 21 09:32 markdown-it
-rwxr-xr-x 1 openint openint 259 Sep 21 09:32 normalizer
-rwxr-xr-x 1 openint openint 236 Sep 21 09:32 openai
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip3
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip3.11
-rwxr-xr-x 1 openint openint 229 Sep 21 09:32 pyftmerge
-rwxr-xr-x 1 openint openint 230 Sep 21 09:32 pyftsubset
-rwxr-xr-x 1 openint openint 230 Sep 21 09:32 pygmentize
lrwxrwxrwx 1 openint openint 15 Sep 21 09:31 python -> /usr/bin/python
lrwxrwxrwx 1 openint openint 6 Sep 21 09:31 python3 -> python
lrwxrwxrwx 1 openint openint 6 Sep 21 09:31 python3.11 -> python
-rwxr-xr-x 1 openint openint 222 Sep 21 09:32 tqdm
-rwxr-xr-x 1 openint openint 227 Sep 21 09:32 ttx
RUN that were deemed necessary were added at the end.
...snip...
USER openint
WORKDIR /home/openint
RUN python -m venv python \
&& . python/bin/activate \
&& pip install \
google-search \
matplotlib \
numpy \
open-interpreter \
pandas \
tiktoken
RUN bash -c '(echo && echo "source ~/python/bin/activate")' >>${HOME}/.bashrc
RUN mkdir bin && bash -c '(echo && echo "PATH=\"$HOME/bin:$PATH\"")' >>${HOME}/.bashrc
COPY 3.5-turbo.py 3.5-turbo-16k.py 4.py 4-32k.py tokenizer.py bin/
RUN . python/bin/activate
~/work/open-interpreter$ docker compose build
~/work/open-interpreter$ docker compose up -d
~/work/open-interpreter$ docker compose exec openint bash
(python) openint@3e8f95436d8a:~$
(python) openint@3e8f95436d8a:~$ which python
/usr/bin/python
(python) openint@3e8f95436d8a:~$ which pip
/usr/bin/pip
(python) openint@3e8f95436d8a:~$ which interprter
(python) openint@3e8f95436d8a:~$
(python) openint@3e8f95436d8a:~$ pip list
Package Version
---------- -------
pip 23.0.1
setuptools 66.1.1
wheel 0.38.4
(python) openint@3e8f95436d8a:~$ ls -la ~/python/bin
total 100
drwxr-xr-x 2 openint openint 4096 Sep 21 09:32 .
drwxr-xr-x 6 openint openint 4096 Sep 21 09:32 ..
-rw-r--r-- 1 openint openint 9033 Sep 21 09:31 Activate.ps1
-rw-r--r-- 1 openint openint 1991 Sep 21 09:31 activate
-rw-r--r-- 1 openint openint 917 Sep 21 09:31 activate.csh
-rw-r--r-- 1 openint openint 2197 Sep 21 09:31 activate.fish
-rwxr-xr-x 1 openint openint 227 Sep 21 09:32 dotenv
-rwxr-xr-x 1 openint openint 231 Sep 21 09:32 f2py
-rwxr-xr-x 1 openint openint 232 Sep 21 09:32 fonttools
-rwxr-xr-x 1 openint openint 228 Sep 21 09:32 gp
-rwxr-xr-x 1 openint openint 254 Sep 21 09:32 huggingface-cli
-rwxr-xr-x 1 openint openint 223 Sep 21 09:32 interpreter
-rwxr-xr-x 1 openint openint 235 Sep 21 09:32 markdown-it
-rwxr-xr-x 1 openint openint 259 Sep 21 09:32 normalizer
-rwxr-xr-x 1 openint openint 236 Sep 21 09:32 openai
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip3
-rwxr-xr-x 1 openint openint 236 Sep 21 09:31 pip3.11
-rwxr-xr-x 1 openint openint 229 Sep 21 09:32 pyftmerge
-rwxr-xr-x 1 openint openint 230 Sep 21 09:32 pyftsubset
-rwxr-xr-x 1 openint openint 230 Sep 21 09:32 pygmentize
lrwxrwxrwx 1 openint openint 15 Sep 21 09:31 python -> /usr/bin/python
lrwxrwxrwx 1 openint openint 6 Sep 21 09:31 python3 -> python
lrwxrwxrwx 1 openint openint 6 Sep 21 09:31 python3.11 -> python
-rwxr-xr-x 1 openint openint 222 Sep 21 09:32 tqdm
-rwxr-xr-x 1 openint openint 227 Sep 21 09:32 ttx
Regards,