Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolcanades authored Aug 7, 2023
1 parent 0a6e0e3 commit 6ab6f44
Showing 1 changed file with 2 additions and 40 deletions.
42 changes: 2 additions & 40 deletions test/functionalTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,6 @@ accumulator-server.py -u

You can use the following Dockerfile to build the accumulator:

```
FROM debian:stable
RUN apt-get update -y
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN pip install Flask==2.0.2
RUN pip install paho-mqtt==1.6.1
COPY . /app
WORKDIR /app
ENTRYPOINT [ "python3", "./accumulator-server.py"]
CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"]
```

**Important note**: copy the accumulator-server.py to the same directory in which Dockerfile is, before running your `docker build` command.

**Probably error**: If during the building of docker image you get a similar error:
```
> [5/8] RUN pip install Flask==2.3.0 #2.0.2:
#0 0.446 error: externally-managed-environment
#0 0.446
#0 0.446 × This environment is externally managed
#0 0.446 ╰─> To install Python packages system-wide, try apt install
#0 0.446 python3-xyz, where xyz is the package you are trying to
#0 0.446 install.
#0 0.446
#0 0.446 If you wish to install a non-Debian-packaged Python package,
#0 0.446 create a virtual environment using python3 -m venv path/to/venv.
#0 0.446 Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
#0 0.446 sure you have python3-full installed.
#0 0.446
#0 0.446 If you wish to install a non-Debian packaged Python application,
#0 0.446 it may be easiest to use pipx install xyz, which will manage a
#0 0.446 virtual environment for you. Make sure you have pipx installed.
#0 0.446
#0 0.446 See /usr/share/doc/python3.11/README.venv for more information.
#0 0.446
#0 0.446 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
#0 0.446 hint: See PEP 668 for the detailed specification.
```
This is produced by the current Dockerfile configuration because tis behavior is specific to the Debian-based container we are using. If you get this error, just change the Dockerfile for:
```
FROM debian:stable
RUN apt-get update -y
Expand All @@ -105,6 +65,8 @@ ENTRYPOINT [ "python3", "./accumulator-server.py"]
CMD ["--port", "1028", "--url", "/accumulate", "--host", "0.0.0.0", "-v"]
```

**Important note**: copy the accumulator-server.py to the same directory in which Dockerfile is, before running your `docker build` command.

Once build (let's say with name 'accum') you can run it with:

```
Expand Down

0 comments on commit 6ab6f44

Please sign in to comment.