[Rust Docker] Run Rust on Docker Container with Docker and Docker Compose
Rust Docker and Docker Compose
Rust is a language empowering everyone to build reliable and efficient software.
This article is about how to run Rust on Docker Container with Docker and Docker Compose.
Prerequisites
-
Docker - https://www.docker.com/
Developing apps today requires so much more than writing code. Multiple languages, frameworks, architectures, and discontinuous interfaces between tools for each lifecycle stage creates enormous complexity.
Docker simplifies and accelerates your workflow, while giving developers the freedom to innovate with their choice of tools, application stacks, and deployment environments for each project.
To learn more about all the features of Docker, see Docker - https://www.docker.com/.
-
Docker Compose - https://docs.docker.com/compose/
Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
To learn more about all the features of Docker Compose, see Docker Compose - https://docs.docker.com/compose/.
Dockerfile
First, make the Dockerfile
file.
1 | # Dockerfile |
Then, build image and run container.
1 | Build image with tag. |
Docker Compose
Make the docker-compose.yml
file.
1 | # Compose file version 3 reference | Docker Documentation |
Run docker-compose
sub commands:
1 | Build image. |
References
[1] rust - https://hub.docker.com/_/rust
[2] Rust Programming Language - https://www.rust-lang.org/