Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docker Builds without style #2608

Unanswered
DemoySegment asked this question in Q&A
Discussion options

Hi all. I am trying to build it locally with Docker using the exact commands in the tutorial. But my built version is missing the styles. I don't why it is happening. Also, all the links in this built version are directed to 0.0.0.0:port instead of localhost:port. Any insight will be helpful. Thanks!
Snipaste_2024年11月16日_13-46-53
Snipaste_2024年11月16日_13-47-45

You must be logged in to vote

Replies: 3 comments 3 replies

Comment options

I experience the same issue.

You must be logged in to vote
1 reply
Comment options

Exactly the same.

Comment options

I haven't worked with the Docker container that much, but usually when this issue occurs it's due to an issue with the _config.yml file and where Jekyll is looking for the files. Something to check might be that the baseurl setting makes sense for working inside of the container.

You must be logged in to vote
1 reply
Comment options

I'm having the same problem. The baseurl is "" in the _config.yml. Any solutions to this?

Comment options

I ran into the same issue and I’m happy to share that I managed to solve it by adding an extra config file specifically for Docker and slightly modifying my docker-compose.yml. 🙌

✅ Step 1: Add a new config file

Create a file called _config_docker.yml with this line:

url: ""

✅ Step 2: Update your docker-compose.yml

Make sure your docker-compose.yml looks like this:

services:
 jekyll-site:
 image: jekyll-site
 build: .
 volumes: [ .:/usr/src/app ]
 ports: [ 4000:4000 ]
 environment: [JEKYLL_ENV=docker]
 user: 1000:1000
 command: jekyll serve --host 0.0.0.0 -w --config _config.yml,_config_docker.yml

The key part is adding the extra config file to the command section and setting the environment variable.

This idea came from a super helpful Stack Overflow post — huge thanks to the folks over there! 🙏

Hope this helps someone else! 😊

You must be logged in to vote
1 reply
Comment options

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /