Comments (6)
Success! I have a working alpine image up on docker hub:
https://hub.docker.com/r/gingerbreadassassin/plotkicadsch
Here's the Dockerfile:
FROM ocaml/opam2:alpine
RUN cd /home/opam && \
git clone https://github.com/jnavila/plotkicadsch.git && \
cd plotkicadsch && \
opam switch 4.07 && \
eval $(opam env) &&\
opam pin add kicadsch . -yn && \
opam pin add plotkicadsch . -yn && \
opam depext kicadsch && \
opam depext plotkicadsch && \
opam install --deps-only kicadsch && \
opam install --deps-only plotkicadsch
RUN cd /home/opam/plotkicadsch && \
sudo chown -R opam:nogroup . && \
opam install --destdir=/home/opam/pksapp plotkicadsch && \
opam depext -ln plotkicadsch | egrep -o "\-\s.*" | sed "s/- //" > depexts
FROM alpine
WORKDIR /opt/pksch
COPY --from=0 /home/opam/pksapp/bin/plotkicadsch plotkicadsch.exe
COPY --from=0 /home/opam/pksapp/bin/plotgitsch plotgitsch.exe
COPY --from=0 /home/opam/plotkicadsch/depexts depexts
RUN cat depexts | xargs apk --update add&& rm -rf /var/cache/apk/* && rm depexts
ENV PATH="/opt/pksch:${PATH}"
It may not be the most efficient or completely correct because I just don't know OCaml at all (as in, today was my very first exposure to it), but the resulting image is ~31MB and has both plotgitsch.exe
and plotkicadsch.exe
in the PATH
, so it's easy to use in builds. Here's a .gitlab-ci.yml
example from a school project:
image: gingerbreadassassin/plotkicadsch
stages:
- build
build:
stage: build
script:
- plotkicadsch.exe -f myproject.sch -l myproject-cache.lib
artifacts:
paths:
- myproject.svg
This was sanitized as the project is private for the time being, but I do plan on expanding this so that diffs will be generated in non-master branches. If I have time this weekend I will make a dummy project and publish it.
If you'd like, I could make a PR to add docker support for this repo.
In any case, I'll close this issue. Thanks again for your help!
from plotkicadsch.
Building from this git repo fails as well. Here's the revised Dockerfile:
FROM ocaml/opam2
RUN sudo apt install m4 git -y
# Have to use >4.06
RUN opam switch 4.07
RUN eval `opam config env`
RUN git clone https://github.com/jnavila/plotkicadsch.git
RUN cd plotkicadsch
RUN opam pin add kicadsch .
RUN opam pin add plotkicadsch .
RUN opam update
RUN opam install plotkicadsch
This now fails with:
[ERROR] The compilation of kicadsch failed at "/home/opam/.opam/4.07/bin/dune subst".
#=== ERROR while compiling kicadsch.0.5.1 =====================================#
# context 2.0.5 | linux/x86_64 | ocaml-base-compiler.4.07.1 | pinned(git+file:///home/opam/opam-repository#master#a13dff5f)
# path ~/.opam/4.07/.opam-switch/build/kicadsch.0.5.1
# command ~/.opam/4.07/bin/dune subst
# exit-code 1
# env-file ~/.opam/log/kicadsch-6-aa74e7.env
# output-file ~/.opam/log/kicadsch-6-aa74e7.out
### output ###
# Error: No .opam files found.
from plotkicadsch.
Yes, I just launched a new build on travis and it failed with the same error. Welcome to yet another dependency hell...
I'll try to push a fix shortly.
from plotkicadsch.
OK, cool. I found a problem in my previous Dockerfile. I got this one to fail with the git-unix
error:
FROM ocaml/opam2:ubuntu-16.04-opam
RUN sudo apt install m4 -y
RUN cd /home/opam
RUN git clone https://github.com/jnavila/plotkicadsch.git && \
cd plotkicadsch && \
opam init -c 4.07.0 --disable-sandboxing -a && \
eval $(opam env) &&\
opam pin add kicadsch . -n && \
opam pin add plotkicadsch . -n && \
opam update && \
opam install -y plotkicadsch
from plotkicadsch.
Please try again building your Docker image.
from plotkicadsch.
It built! But plotkicadsch
is only available from within the container if I run opam switch 4.07.0
, so I have to fix that bit. I'll test the image to see if it works.
from plotkicadsch.
Related Issues (20)
- git is changing to the master branch HOT 13
- plotgitsch command performs checkout to master HOT 2
- Running on Windows HOT 7
- Limit gitplotsch scope in nested projects HOT 20
- Do not fail when a part is missing HOT 14
- Flag for generating/keeping images even if the images do not have changes
- Commit info HOT 6
- Short version of the help and version flags HOT 9
- Intermediate images do not have a transparent background HOT 6
- Exception (Invalid_argument "index out of bounds") HOT 2
- Minor details in the produced image HOT 2
- Internal error when it finds (maybe broken) symlinks HOT 18
- Keeping original files even if they don't have changes HOT 18
- Makefile - Making package
- Diffing local changes does not work when an untracked folder is into the repo HOT 9
- License type HOT 2
- Do you have a. Kicad SCH format to support KICad 6.0 HOT 3
- Plotkicadsh fails with missing components HOT 4
- plotgitsch could return 1 when at least of the commits is using the new `.kicad_sch` format
- Distro-specific issue and possible patch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotkicadsch.