We reviewed the "gofile" ( https://github.com/felipecruz91/gofile ) application Felipe created and its Dockerfile ( https://github.com/felipecruz91/gofil... ). The existing Dockerfile is interesting for a number of reasons. It has a number of good qualities we'll call out and discuss in addition to discussing what kind of improvements to make and what kind of gotchas to watch out for.
"gofile" is a statically compiled application and it uses Alpine for its container base image. We explored what you should be aware of working with compiled applications and using Alpine.
Finally, we also talked about "gofile" itself, what it does and building simple container images without Dockerfiles.
If you have a Dockerfile you'd like to improve or if you'd like to share a good Dockerfile you have or discovered submit it here for us to review: https://GoodDockerfiles.com
REFERENCES:
If you need to containerize a Golang-based application the following tutorials will be useful to you:
"Building Container Images FROM Scratch: 6 Pitfalls That Are Often Overlooked" - https://labs.iximiuz.com/tutorials/pi...
"How to Build Smaller Container Images: Docker Multi-Stage Builds" - https://labs.iximiuz.com/tutorials/do...
"Build a Production-Ready Go Container Image: A Dynamically Linked Application" - https://labs.iximiuz.com/challenges/d...
If you want to build your own Dockerfile alternative with BuildKit take a look at these resources:
https://mattrickard.com/building-a-ne...
https://github.com/moby/buildkit/blob...
If you want to containerize a Golang app without using Dockerfiles you have a number of options:
"gofile" - https://github.com/felipecruz91/gofile
"mint" (MinToolkit aka DockerSlim) and its "imagebuild" command (example: `mint imagebuild --engine simple --exe-path ./local/path/to/appexe --image-name my-app-container:latest --runtime-load docker` ) - https://github.com/mintoolkit/mint
"ko" - https://github.com/ko-build/ko
Watch video Good Dockerfiles - Ivan and Kyle Are reviewing a Golang app Dockerfile for "gofile" with Felipe Cruz online, duration hours minute second in high quality that is uploaded to the channel Cloud Native Container Craft with Ivan and Kyle 01 January 1970. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 188 times and liked it 10 visitors.