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

Bygg i docker #272

Open
rolfrander opened this issue May 20, 2021 · 5 comments
Open

Bygg i docker #272

rolfrander opened this issue May 20, 2021 · 5 comments

Comments

@rolfrander
Copy link

Hei, dette er innspill til byggeprosessen, ikke innholdet i teksten. Jeg har laget en Dockerfile med det jeg tror er nødvendige avhengigheter for å klare å bygge pdf/html (jeg fikk det i hvert fall til å virke med dette). Kanskje nyttig for andre også.

FROM openjdk:17-buster

ENV PLANTUML_VERSION 1.2021.6
ENV LANG en_US.UTF-8

RUN apt update

RUN apt install -y graphviz curl git make
RUN apt install -y --no-install-recommends python2-minimal python3-minimal
RUN apt install -y --no-install-recommends pandoc libxml2-utils dblatex xmlto texlive-lang-european

# install plant manually to avoid dragging entire java/X11 dependency tree
RUN curl -L https://sourceforge.net/projects/plantuml/files/plantuml.${PLANTUML_VERSION}.jar/download -o /usr/local/lib/plantuml.jar 
RUN echo "#!/bin/bash" >> /usr/local/bin/plantuml ; echo 'java -jar /usr/local/lib/plantuml.jar "$@"' >> /usr/local/bin/plantuml
RUN chmod +x /usr/local/bin/plantuml
@petterreinholdtsen
Copy link
Collaborator

petterreinholdtsen commented May 20, 2021 via email

@rolfrander
Copy link
Author

Hehe, godt spørsmål. Jeg er enig i prinsippet om å ikke laste ned binære filer direkte fra internett.

Det jeg forsøker å unngå er dette:

# apt-get install -s --no-install-recommends plantuml
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ant ca-certificates-java default-jre default-jre-headless java-common java-wrappers libapache-pom-java libasound2
  libasound2-data libavalon-framework-java libbatik-java libcommons-io-java libcommons-logging-java libcommons-parent-java
  libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libel-api-java libfontbox2-java libfop-java
  libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libjaxp1.3-java libjlatexmath-java libjsp-api-java
  libllvm7 libnspr4 libnss3 libpciaccess0 libpcsclite1 libqdox-java libsensors-config libsensors5 libservlet-api-java
  libservlet3.1-java libwebsocket-api-java libx11-xcb1 libxalan2-java libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0
  libxcb-sync1 libxdamage1 libxerces2-java libxfixes3 libxml-commons-external-java libxml-commons-resolver1.1-java
  libxmlgraphics-commons-java libxshmfence1 libxtst6 libxxf86vm1 openjdk-11-jre openjdk-11-jre-headless
Suggested packages:
  ant-doc default-jdk | java-compiler | java-sdk libasound2-plugins alsa-utils libavalon-framework-java-doc librhino-java
  libcommons-io-java-doc libcommons-logging-java-doc libexcalibur-logkit-java liblog4j1.2-java pciutils pcscd libqdox-java-doc
  junit lm-sensors libxalan2-java-doc libbsf-java libxsltc-java libxerces2-java-doc libxml-commons-resolver1.1-java-doc
  libxmlgraphics-commons-java-doc libnss-mdns fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
  | fonts-wqy-zenhei fonts-indic
Recommended packages:
  ant-optional icc-profiles-free libsaxon-java libatk-wrapper-java-jni fonts-dejavu-extra
The following NEW packages will be installed:
  ant ca-certificates-java default-jre default-jre-headless java-common java-wrappers libapache-pom-java libasound2
  libasound2-data libavalon-framework-java libbatik-java libcommons-io-java libcommons-logging-java libcommons-parent-java
  libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libel-api-java libfontbox2-java libfop-java
  libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libjaxp1.3-java libjlatexmath-java libjsp-api-java
  libllvm7 libnspr4 libnss3 libpciaccess0 libpcsclite1 libqdox-java libsensors-config libsensors5 libservlet-api-java
  libservlet3.1-java libwebsocket-api-java libx11-xcb1 libxalan2-java libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0
  libxcb-sync1 libxdamage1 libxerces2-java libxfixes3 libxml-commons-external-java libxml-commons-resolver1.1-java
  libxmlgraphics-commons-java libxshmfence1 libxtst6 libxxf86vm1 openjdk-11-jre openjdk-11-jre-headless plantuml

Jeg kan ikke apt godt nok til å vite hvordan jeg hinter om å bruke jre-headless...

I et forsøk på å finne ut hva som var beste måte å installere java i docker ble jeg så forvirret at jeg endte opp med å basere meg på standard openjdk-image utelukkende for å ha java tilgjengelig for plantuml. Men det ser ikke ut til at apt i det imaget vet om at jre er installert, så derfor vil plantuml dra med seg hele.

@petterreinholdtsen
Copy link
Collaborator

petterreinholdtsen commented May 20, 2021 via email

@petterreinholdtsen
Copy link
Collaborator

petterreinholdtsen commented May 21, 2021 via email

@rolfrander
Copy link
Author

[Petter Reinholdtsen]
Men jeg anbefaler ikke denne løsningen, jeg vil heller foreslå å ta utgangspunkt i et enkelt Debian-docker-avtrykk og så bruke openjdk fra Debian.

Her falt jeg av, jeg forstår ikke hvordan skal dette kunne omgå koblingen fra plantuml til default-jre, men her er jeg langt utenfor min kunnskap om apt/dpkg...

Uansett, dette er grunnen til at jeg tok utgangspunkt i et standard java-docker-avtrykk og lastet ned plantuml.jar med curl...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants