Building the docker image locally #27

Closed
opened 2024-07-18 18:49:06 +00:00 by Evhorizon · 4 comments

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 to 4get:latest?
Other instructions that I have found elsewhere recommend using make build instead of docker build, but I'm not that familiar with building images. Could you setup a quick guide for this too? Thanks 😄

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` to `4get:latest`? Other instructions that I have found elsewhere recommend using `make build ` instead of `docker build`, but I'm not that familiar with building images. Could you setup a quick guide for this too? Thanks 😄
Collaborator

Hello! :D

should I run: docker build -t 4get:latest . and change image: luuul/4get:latest to 4get:latest?

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 run docker build -t luuul/tor .

Other instructions that I have found elsewhere recommend using make build instead of docker build,

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

Hello! :D >should I run: `docker build -t 4get:latest .` and change image: luuul/4get:latest to 4get:latest? 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 run `docker build -t luuul/tor .` >Other instructions that I have found elsewhere recommend using make build instead of docker build, 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
Author

Hey @throwaway thank you for responding:)

Sure you could do that. It would be easier to run docker build -t luuul/4get:latest  .

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.

Hey @throwaway thank you for responding:) > Sure you could do that. It would be easier to run docker build -t luuul/4get:latest . 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.
Collaborator

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

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
Author

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 the docker build -t luuul/4get:latest . command is the quickest way. Maybe this could be added to the official docker instructions?

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 the `docker build -t luuul/4get:latest .` command is the quickest way. Maybe this could be added to the official docker instructions?
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lolcat/4get#27
No description provided.