Ubuntu Image with XCFEM - Finite element analysis package civil engineering structures
1.6K

I am not the author of the XCFEM library and have no affiliation with its developers or maintainers. This Docker image was created independently to streamline the setup process and help other developers more easily use the XCFEM library.
Important
This image reflects the environment I personally use for studies and has been configured to the best of my knowledge. I make no guarantees regarding the accuracy, reliability, or performance of the XCFEM library or this Docker image. I accept no responsibility or liability for any issues, damages, or losses that may arise from the use of this image or the XCFEM library.
Please ensure that you read and understand the XCFEM library’s terms of use and licensing before proceeding. Use this Docker image at your own risk.
More about XCFEM on their official repository: https://github.com/xcfem/xc
Each tag will follow the following convention:
image:operating-system-YYYYMMDD.v
...where the v attribute is just a counter for the version of that particular day
Example: engthiago/xcfem:ubuntu24.04-20250414.1
The below installation process works on Linux and Windows, MacOsX has not been tested.
To get started, enter your Powershell on Windows or Bash on Linux, then navigate to a directory you which you want to keep your files and create a directory called xc, you can use the below code to do that:
cd ~ && mkdir xc && cd xc
The cd ~ command will navigate to your home directory, it works on both Powershell and Bash. You can choose to use a different directory, the process should work just the same.
Now run the image, docker will automatically pull (download) and run the image for you.
docker run -it --mount "type=bind,source=${PWD},target=/home/ubuntu" --name xcfem engthiago/xcfem
The --mount argument will bind the current working directory to the /home/ubuntu directory inside of the docker container, making it easy for you to run these files on XC and work with source control without the need to include XC source code.
After Docker finish with its thing, you should be inside of the docker container with XC environment ready to be used. If everything worked correctly you will see the following on your terminal:
root@d555144909db:/home/ubuntu#
...where d555144909db is the id Docker has assigned your container.
Any files and folders created on the home/ubuntu directory will be reflected on the xc folder in the host environment, and vice versa.
Note
This Image will always dettach a specific commit from the repository to guarantee the environment works, if you wish to update to the latest version of XC, you can switch to the master branch and follow the installation instructions found on xc official documentation.
Optional: If you wish to run installation verification tests your can run the following command inside of the container:
cd /xc_install/xc/verif && sh run_verif.sh && cd /home/ubuntu
To exit the container, simply run exit in your terminal, just like any other docker container:
exit
After the first run, the docker run command will not work, because the container name is in use, simply restart and re-attach to the terminal, as long as you keep the host folder created and mounted before, everything will work the same:
docker start -ai xcfem
The image locks a specific commit which assures XC and its dependencies work correctly, but if you wish to update XC version go to the install folder and checkout the master branch:
cd /xc_install && git checkout master
Then, follow the instructions on the official installation process for XC link
The source code for the Docker image can be found here.
You can build it navigating to its local folder and running Docker build command:
docker build -t my-xc-image .
...where my-xc-image is the name you wish to give to your image
There are some optional arguments that can be used when build:
docker build -t my-xc-image --build-arg MAKE_WORKERS=4 --build-arg RUN_TESTS=1 --build-arg XC_COMMIT_ID=0081f13 .
...where
MAKE_WORKERS = 4 means Make will run with 4 process (threads).
RUN_TESTS = 1 means testing verification code for XC will be run after the installation process is done, 0 is the default, which ignores this step.
XC_COMMIT_ID = 0081f13 is the commit id from XC repository that will be used for building the image and its source code. This guarantees a specific version of XC to the image.
Content type
Image
Digest
sha256:2f2c56205…
Size
1.8 GB
Last updated
over 1 year ago
docker pull engthiago/xcfem