Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mark to 9.11.1 #16

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
FROM python:3-slim AS builder
ENV MARK="9.9.0"

FROM python:3.11-slim AS builder
ENV MARK="9.11.1"
ADD . /app
WORKDIR /app

RUN pip install --target=/app -r requirements.txt && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y tar curl gnupg2 && \
rm -rf /var/lib/apt/lists/* && \
curl -LO https://github.com/kovetskiy/mark/releases/download/${MARK}/mark_Linux_x86_64.tar.gz && \
tar -xvzf mark_Linux_x86_64.tar.gz && chmod +x mark && mv mark /usr/local/bin/mark \
&& curl -L https://dl-ssl.google.com/linux/linux_signing_key.pub |apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
&& apt update && apt-get install -y google-chrome-stable
tar -xvzf mark_Linux_x86_64.tar.gz && chmod +x mark && mv mark /usr/local/bin/mark && rm mark_Linux_x86_64.tar.gz \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

FROM python:3-slim
FROM chromedp/headless-shell:114.0.5735.199
RUN apt-get update \
&& apt-get install --no-install-recommends -qq ca-certificates bash sed git dumb-init python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=builder /app /app
COPY --from=builder /usr/local/bin/mark /usr/bin/mark
COPY --from=builder /usr/bin/google-chrome /usr/bin/google-chrome
WORKDIR /app
ENV PYTHONPATH /app
ENV DOC_PREFIX /github/workspace/
ENV LOGURU_FORMAT "<lvl>{level:7} {message}</lvl>"
USER 1001:1001
ENTRYPOINT [ "python" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quite big security concern, it will require an explicit exception to run it on our clusters. (Kyverno will prevent it to run at all, afaik)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. How come we have to perform this change now? Did it work before with the unprivileged user?
The doc seems to go in the direction of that change though: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no not really. I had to add this to my action to get it to work which is awful

   - name: chown files to UID 1001
     shell: bash
     run: sudo chown -R 1001:1001 *

CMD ["/app/mark2confluence/main.py"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["python3", "/app/mark2confluence/main.py"]
Loading