Using the official Docker container for CI/CD #8224
-
I'm using Gitlab and have taken a look at the following guides:
What's a bit of a surprise is that neither of these use the official Docker container. Because I'm using Gitlab with Docker for my CI/CD stages I'd like to make use of a docker container to save pulling Python packages every time code is pushed to my Git repository. What's a bit strange is that it seems something within MkDocs is calling out to a shell executable and it's failing. Here's my CI script thus far (.gitlab-ci.yml): image: squidfunk/mkdocs-material
test:
stage: test
script:
- mkdocs build --strict --verbose --site-dir test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
pages:
stage: deploy
script:
- mkdocs build --strict --verbose
artifacts:
paths:
- site
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH Here's the error I'm getting from Gitlab's build phase:
The only thing that's changed here is the Docker image used, where before I was using Is there anything specific I need to do? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sorry, I think I've found a reasonable duplicate here: Changing the question purpose here for others in the future, is there a reason to not use this Docker image for CI/CD? It seems well updated and I don't intend to serve files from it. Trying |
Beta Was this translation helpful? Give feedback.
-
To close off the "how" and leave the "why not" question open, I needed to override the entrypoint in Gitlab. This now works: image:
name: squidfunk/mkdocs-material
entrypoint: [""]
test:
stage: test
script:
- mkdocs build --strict --verbose --site-dir test
artifacts:
paths:
- test
rules:
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
... |
Beta Was this translation helpful? Give feedback.
To close off the "how" and leave the "why not" question open, I needed to override the entrypoint in Gitlab.
This now works: