Skip to content

Commit 27f6e10

Browse files
committed
add docker files for linux
1 parent 98ac152 commit 27f6e10

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

docker/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Pydyna-pre service Linux-based Dockerfile
2+
3+
FROM python:3.8-slim-buster
4+
5+
# Define the working directory
6+
WORKDIR /server
7+
8+
# Install unzip
9+
RUN apt-get update && apt-get install -y unzip
10+
11+
# Add the binary files from the latest release
12+
COPY linux-binaries.zip .
13+
RUN unzip -qu linux-binaries.zip && rm linux-binaries.zip
14+
15+
RUN pip3 install grpcio grpcio-tools protobuf
16+
17+
RUN python -m grpc_tools.protoc --python_out=./linux-binaries --grpc_python_out=./linux-binaries -I./linux-binaries ./linux-binaries/kwprocess.proto
18+
19+
CMD ["python3", "./linux-binaries/kwserver.py"]

docker/README.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Create your own pydyna-pre service docker container
2+
=================================================
3+
4+
The pydyna-pre service Docker containers can be easily built by following
5+
these steps.
6+
7+
Inside this folder, the instructions (i.e. ``Dockerfile.*`` files) for
8+
building the pydyna-pre service Docker containers are made available.
9+
10+
* ``Dockerfile``: this file builds the Linux-based Docker image.
11+
12+
Prerequisites
13+
^^^^^^^^^^^^^
14+
15+
* Ensure that ``docker`` is installed in your machine.
16+
If you do not have ``docker`` available, please refer to the
17+
`official Docker site <https://www.docker.com>`_.
18+
19+
* Download the latest release artifacts for the Linux
20+
Docker container. You can do this as follows:
21+
22+
* Latest Linux artifacts: `linux-binaries.zip <https://github.com/ansys/pydyna/releases/latest/download/linux-binaries.zip>`_
23+
24+
* Move these ``.zip`` files to the current location (i.e. ``<repository-root-folder>/docker``).
25+
26+
Building the Docker images
27+
^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
29+
In order to build your images, follow the next instructions:
30+
31+
* Locate yourself at ``<repository-root-folder>/docker`` in your terminal.
32+
* Run the following Docker command:
33+
34+
.. code:: bash
35+
36+
docker build -t ls-pre .
37+
38+
* Check that the image has been created successfully. You should see an output similar
39+
to this one when running the following command:
40+
41+
.. code:: bash
42+
43+
docker images
44+
45+
>>> REPOSITORY TAG IMAGE ID CREATED SIZE
46+
>>> ls-pre *******-latest ............ X seconds ago 187MB
47+
>>> ...... ...... ............ .............. ......

0 commit comments

Comments
 (0)