Building a docker image
docker build . -t yuriyni/reactjs_frontend
Push docker image to docker hub
docker push yuriyni/reactjs_frontend
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-10.png?resize=951%2C260&ssl=1)
Pull new images on aws ec2
docker compose pull
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image.png?resize=695%2C259&ssl=1)
oops, seems like I need more memory
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-1.png?resize=559%2C106&ssl=1)
we can try to remove images we do not need anymore
docker image ls
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-2.png?resize=645%2C112&ssl=1)
docker rmi 13fd578342d5
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-3.png?resize=665%2C148&ssl=1)
then let’s remove the second one
docker rmi a6d8977ec03f
ok DONE
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-4.png?resize=471%2C84&ssl=1)
If we try to call docker-compose, it will only show the currently running containers
docker compose up -d
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-5.png?resize=479%2C89&ssl=1)
so we have to pull new images from the docker hub one more time, due to a thrown memory error
docker compose pull
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-6.png?resize=628%2C240&ssl=1)
And we could see that everything was completed successfully
Let’s call docker-compose again
docker compose up -d
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-7.png?resize=489%2C104&ssl=1)
recreating is in progress…
The status became Started
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-8.png?resize=437%2C108&ssl=1)
And finally Running
![](https://i0.wp.com/yuriyni.com/wp-content/uploads/2023/10/image-9.png?resize=467%2C188&ssl=1)
sometimes or always you should check and monitor the container list
docker ps -a