In Docker Installation, we explained how to install Docker on an Arm server. Now let’s look at how to run the containerized application on the AWS Arm instance.
There are several ways to get a Docker image onto this cloud instance, from rebuilding it locally from a Dockerfile to pulling a pre-compiled image from Docker Hub. In Multi-architecture images, we pushed the PHP example images to Docker Hub so that we can run them immediately.
Follow these steps to run the PHP Docker image on an Arm server:
- Run the following command in the terminal in the AWS instance:
$ docker run --rm -it -p 80:80 jasonrandrews/php-exampleUsing the
docker runcommand will automatically fetch the image from Docker Hub, if the image is not found locally. Running this command pulls the application from Docker Hub and run it on this AWS A1 instance.
- Open a web browser and paste the IP address of the A1 instance into the browser to view the PHP example application. The same PHP example application appears with the uname -m showing AArch64.
The Docker image was developed using multi-architecture containers. This means that the behavior during development and deployment will be the same, even though the application was developed on a different hardware architecture than Arm.
In Execute on an embedded device, we will look at how to use the PHP example application on an embedded device.