uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

Create my own docker image from my fork

Open CreaCloudz opened this issue 2 years ago • 12 comments

⚠️ Please verify that this bug has NOT been raised before.

  • [X] I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

Hello, I made a fork of your monitoring system I would like to make a docker image of my fork how is this possible? Thank you for your help.

🐻 Uptime-Kuma Version

Lastest Custom

💻 Operating System and Arch

Ubuntu 22.04 LTS (GNU/Linux 5.15.0-41-generic x86_64)

🌐 Browser

Microsoft Edge

🐋 Docker Version

Latest

🟩 NodeJS Version

Latest

CreaCloudz avatar Jul 28 '22 09:07 CreaCloudz

If you go to the /docker directory of the repository, you'll find a dockerfile. From there, you can run docker build to build out the docker image, and then run it like every other image 😄

AnnikenYT avatar Jul 28 '22 12:07 AnnikenYT

If you go to the /docker directory of the repository, you'll find a dockerfile. From there, you can run docker build to build out the docker image, and then run it like every other image 😄

image

CreaCloudz avatar Jul 28 '22 13:07 CreaCloudz

Please check these commands:

https://github.com/louislam/uptime-kuma/blob/df7f0b078db12c011286389ae1867f8aa2d8f095/package.json#L33-L37

louislam avatar Jul 28 '22 14:07 louislam

it doesn't help me much..

CreaCloudz avatar Jul 28 '22 16:07 CreaCloudz

it doesn't help me much..

Didn't see these, try npm run build-docker or yarn build-docker.

AnnikenYT avatar Jul 28 '22 18:07 AnnikenYT

Hi, i've been trying to build docker image locally. after solving lot of issues I ended up here image Do we have any procedure or docs for this?

Can someone help me here?

satyamsettyeswara avatar Sep 07 '22 17:09 satyamsettyeswara

Hi, i've been trying to build docker image locally. after solving lot of issues I ended up here image Do we have any procedure or docs for this?

Can someone help me here?

You need to set the environment variable VERSION.

Alternatively, you can edit package.json and change the name louislam/uptime-kuma:$VERSION to whatever you want.

louislam avatar Sep 08 '22 13:09 louislam

Hi @louislam, I was able to create the docker image in my local system by updating the package.json with "build-docker-debian": "node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64 -t kuma/uptime-kuma . --load"

I checked the container to see my changes and changes were present But there is one problem, my changes are not reflecting when i access the website. Could you provide some help??

satyamsettyeswara avatar Sep 10 '22 13:09 satyamsettyeswara

Hi @CreaCloudz, I was finally able to figure out. How to built a docker image in my local system.

Solution:

  1. Run npm run build-dist-and-restart which builds the dist(if dist folder is already present you have to delete it first and run this command).
  2. Stop the running process(CTRL+C) after the dist folder is created with all the files or when the console shows Listening on PORT 3001
  3. Next Comment from line 24 to the end in the docker/dockerfile (why? because I don't have permission to upload to github the artifacts) and save it.
  4. Update build-docker-debian command in package.json to "build-docker-debian": "node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64 -t kuma/uptime-kuma . --load"(this is for windows for others you have to update the platform tag).
  5. Now run npm run build-docker-debian it creates the docker image with our changes.
  6. Next you can run the command that creates the container docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma kuma/uptime-kuma

voilà there you have it.🥳

@louislam Please comment if there were any mistakes

satyamsettyeswara avatar Sep 11 '22 07:09 satyamsettyeswara

@satyamsettyeswara 's hack worked for me, but it seems like there should be a simpler way.

Joseph94m avatar Sep 12 '22 13:09 Joseph94m

@Joseph94m I do think the same. after a while i was able to deduce the commands to this

Solution:

  1. Comment from line 24 to the end in the docker/dockerfile (why? because we don't have permission to upload to github the artifacts) and save it.
  2. Add new command to your package.json file command: "build-myimage": "npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64 -t kuma/uptime-kuma . --load" package.json should look like this image
  3. Next run this command to create you own image npm run build-myimage

/cheers

satyamsettyeswara avatar Sep 17 '22 08:09 satyamsettyeswara

We are clearing up our old issues and your ticket has been open for 3 months with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Dec 16 '22 12:12 github-actions[bot]

This issue was closed because it has been stalled for 2 days with no activity.

github-actions[bot] avatar Dec 18 '22 18:12 github-actions[bot]