Running and Verification
Procedure
- Obtain the built-in test cases.
cd /path/to/ git clone https://github.com/crystal-lang/crystal.git
- Run Crystal using a container.
docker run -it 84codes/crystal:latest-fedora-37
- View the container ID.
docker ps -a
If CONTAINER ID is displayed in the command output, the container is running properly.

- Export the container and import the test case to re-create a container.
docker export caf67ade6d37 > crystal.tar mkdir crystal-example tar xf crystal.tar -C crystal-example rm -rf crystal.tar cp -r crystal/samples/* crystal-example/home cd crystal-example tar cf crystal.tar *
- Import the container.
docker import - crystal:example < crystal.tar docker images
If the following information is displayed, the import is successful.

- Use Crystal to run the binary-trees.cr, red_black_tree.cr, and pig.cr test cases.
docker run -it crystal:example /usr/bin/crystal run /home/binary-trees.cr
If the following information is displayed, the running is successful.

docker run -it crystal:example /usr/bin/crystal run /home/red_black_tree.cr
If the following information is displayed, the running is successful.

docker run -it crystal:example /usr/bin/crystal run /home/pig.cr
If the following information is displayed, the running is successful.

Parent topic: Crystal 1.7.2 Porting Guide (Kylin V10)