Giter Club home page Giter Club logo

Comments (14)

george-gca avatar george-gca commented on June 2, 2024

Maybe we could also ditch docker hub and migrate to using GitHub Container registry in the same step? I've seen some other people implementing this like here.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

Maybe we could also ditch docker hub and migrate to using GitHub Container registry in the same step? I've seen some other people implementing this like here.

Does the Github Container registry solves any problem? What does it offer compared to dockerhub?

Currently, Dockerhub compresses our image from 1.3 GB to 500MB. Does it compress the image?

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

First you should use docker compose up to pull the image.

Then build an optimized version using:

docker-slim build --compose-file docker-compose.yml --target-compose-svc jekyll

Then, tag the image as slim:

docker image tag amirpourmand/al-folio.slim amirpourmand/al-folio:slim

Image size is reduced to 188 MBs.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

To Do: https://github.com/kitabisa/docker-slim-action

from al-folio.

george-gca avatar george-gca commented on June 2, 2024

Oh I didn't know about the compressing feature. I suggested simply because we use GitHub already, so for keeping it all up in one provider. Also Docker did a terrible job communicating changes lately, although they reverted their decisions.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

The slim version is now available at this URL:

docker pull ghcr.io/pourmand1376/al-folio:slim

Test it if you can. You can also change the image name in docker-compose.yml to ghcr.io/pourmand1376/al-folio:slim.
It is very lightweight (188 MB) compared to the standard 500MB.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

You can also use a one-liner to use the slim image:

docker run --rm -v "$PWD:/srv/jekyll/" -p "8080:8080" ghcr.io/pourmand1376/al-folio:slim

from al-folio.

george-gca avatar george-gca commented on June 2, 2024

Currently throwing an error @pourmand1376:

Dependency Error: Yikes! It looks like you don't have jekyll-get-json or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. If you've run Jekyll with bundle exec, ensure that you have included the jekyll-get-json gem in your Gemfile as well. The full error message from Ruby is: 'cannot load such file -- jekyll-get-json' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

Let's dig it. It is far more problematic than I thought.

Just, let this be open for a month or two. Perhaps, someone expert on docker does something. Otherwise, 400MB is not that much and it is okay for now.

from al-folio.

george-gca avatar george-gca commented on June 2, 2024

Maybe the only thing missing here is an updated docker image. The jekyll-get-json dependency it is complaining about was recently introduced in #1547. Can you try to generate a newer version so I can check if it works? Or how can I try to create one myself? Is it just the steps you posted here?

First you should use docker compose up to pull the image.

Then build an optimized version using:

docker-slim build --compose-file docker-compose.yml --target-compose-svc jekyll

Then, tag the image as slim:

docker image tag amirpourmand/al-folio.slim amirpourmand/al-folio:slim

Image size is reduced to 188 MBs.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

Maybe the only thing missing here is an updated docker image. The jekyll-get-json dependency it is complaining about was recently introduced in #1547. Can you try to generate a newer version so I can check if it works? Or how can I try to create one myself? Is it just the steps you posted here?

First you should use docker compose up to pull the image.
Then build an optimized version using:

docker-slim build --compose-file docker-compose.yml --target-compose-svc jekyll

Then, tag the image as slim:

docker image tag amirpourmand/al-folio.slim amirpourmand/al-folio:slim

Image size is reduced to 188 MBs.

That's true. Most probably there is an issue with a dependency or something. However, It can not be updated manually.

It should be updated automatically. As far as I know, there isn't any automatic way of using docker-slim.

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

I have implemented docker-slim on github actions. However, it is not working very good (no error).

from al-folio.

george-gca avatar george-gca commented on June 2, 2024

Can we close this issue @pourmand1376?

from al-folio.

pourmand1376 avatar pourmand1376 commented on June 2, 2024

Yes. This is finished.

One thing is still left to answer. When should we make this slim version the default version? As I see, It is basically the same but less in size. However, there may be some unpredicted issues.

from al-folio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.