Building the docker image locally #27
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hey @lolcat and @throwaway, I didn't find the instructions to build the docker images (4get and tor) locally, AFAIK different devs recommend a different approach. I have created a 4get folder with the Dockerfile and the docker-compose.yaml inside, should I run:
docker build -t 4get:latest .
and change
image: luuul/4get:latest
to4get:latest
?Other instructions that I have found elsewhere recommend using
make build
instead ofdocker build
, but I'm not that familiar with building images. Could you setup a quick guide for this too? Thanks 😄Hello! :D
Sure you could do that. It would be easier to run
docker build -t luuul/4get:latest .
This way you wouldn't need to make changes to the example docker-compose.yaml
to build the tor image you just need to cd into
docker/tor/
and rundocker build -t luuul/tor .
Cool! It seems you just need a Makefile with the docker commands in it.
some examples
https://earthly.dev/blog/docker-and-makefiles/
https://dev.to/flpslv/using-makefiles-to-build-and-publish-docker-containers-7c8
Hey @throwaway thank you for responding:)
But won't that pull the remote docker image? Id like to build it locally instead in order to have the latest updates to the code immediately available.
images are only pulled if they aren't available locally. If you build and tag luuul/4get:latest then it would be used when you run docker compose up.
You can see this in action if you delete all 4get images from your host, build, and then start containers with docker compose. You'll notice that it doesn't need to pull from dockerhub
Ahh that sounds good! So if I build with the
luuul/4get:latest
tag , docker wouldnt need to pull it and I can keep the docker-compose.yaml as it is. Also, from the examples that you kindly posted, it looks like this makefile should actually be created, so I think that thedocker build -t luuul/4get:latest .
command is the quickest way. Maybe this could be added to the official docker instructions?