Fly.ioTutorial
Fly Friday - Customizing with Dockerfiles
Summary
Fly Friday describes how to customize a Docker image before deploying it to Fly, building on an earlier example that deployed Docker’s official httpd image. The default image serves files from /usr/local/apache2/html and displays “It works”; replacing that content requires adding local HTML files to the image. A two-line Dockerfile uses FROM httpd:2.4 as the base and COPY ./public_html/ /usr/local/apache2/htdocs/ to place the contents of a public_html directory into the new image, which Fly then deploys. The post also notes that the directory must be created and populated with HTML, and points to a video and Fly Docs, including a hands-on path to a free account and first app deployment.
Context
The deployed Docker httpd image displays “It works” by default, so different content requires copying local HTML files into the image’s serving directory.
Approach / What changed
Create a public_html directory with HTML content and use a two-line Dockerfile based on httpd:2.4. The Dockerfile copies that directory into the new image, which Fly deploys.
Takeaways
The Dockerfile uses FROM httpd:2.4 to build a customized image from Docker’s official httpd image.
COPY ./public_html/ /usr/local/apache2/htdocs/ transfers the local HTML content into the new image.
The public_html directory must be created and populated before the customized image is deployed.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.