独自のMAPDL dockerコンテナを作成する#
警告
このセクションで説明する手順を実行するには、有効な Ansys ライセンスと Ansys アカウントが必要です。
このページに記載されている手順に従って、独自の MAPDL docker コンテナを作成することができます。このガイドでは、ローカルの Ubuntu マシンを使用して、最初に Ansys 製品をインストールして MAPDL コンテナに必要なファイルを生成し、生成されたファイルをコンテナにコピーします。
必要条件#
A linux machine, preferable with Ubuntu 20.04 or later. CentOS Linux distribution is not supported anymore. This machine needs to have Docker installed.
A valid Ansys account. Your Ansys reseller should have provide you with one.
The following provided files:
プロシージャー#
Ansys MAPDLインストールファイルのダウンロード#
Download latest Ansys MAPDL version from the customer portal (Current Release). You need to have a valid Ansys account with access to products downloads.
Ansysのアカウントがない場合は、IT管理者にお問い合わせください。
Install Ansys MAPDL product#
To install Ansys MAPDL product on an Ubuntu machine you can follow MAPDLをインストールする. if you are using the graphical user interface or Install Ansys products for the command line interface. The later approach can be reused with small changes in a continuous integration workflow.
To reduce the size of the final image, you might want to install the minimal files by using:
sh /path-to-mapdl-installer \
-install_dir /path-to-install-mapdl/ \
-nochecks -mechapdl -ansyscust -silent
This command install Mechanical MAPDL (-mechapdl
) and the
custom routines (-ansyscust
) such as UPF.
Please take note of where you are installing ANSYS because the directory path is need in the following section.
Build Docker image#
To build the Docker image, you need to create a directory and copy all the files you need in the image.
The steps to copy those files and build the image are detailed in the following script, which you should modify to adapt it to your needs.
# Creating working directory
mkdir docker_image
cd docker_image
# Copying the docker files
cp ./path-to-pymapdl/pymapdl/docker/Dockerfile
cp ./path-to-pymapdl/pymapdl/docker/.dockerignore
# Creating env vars for the Dockerfile
export VERSION=242 # MAPDL version
export TAG="V242" # docker container tag
export MAPDL_PATH=/path_to_mapdl_installation/ansys_inc
# Build Docker image
sudo docker build -t $TAG --build-arg VERSION=$VERSION --build-arg MAPDL_PATH=$MAPDL_PATH
Please notice that:
path-to-pymapdl
is the path where PyMAPDL repository is located.path_to_mapdl_installation
is the path to where you have locally installed ANSYS MAPDL.
Not all the installation files are copied, in fact, the files ignored during the copying are detailed in the file .dockerignore.
The Docker container configuration needed to build the container is detailed in the Dockerfile.
まとめ#
Step 1: Download latest Ansys MAPDL version from the customer portal (Current Release).
Step 2: Install Ansys MAPDL in a known folder. You can reuse your local installation if it is updated and the machine is running the same Ubuntu version as the targe Ubuntu docker version.
Step 3: Build the docker image with the provided Docker configuration files and script.