lf-lang / lingua-franca

Intuitive concurrent programming in any language
https://www.lf-lang.org
Other
231 stars 62 forks source link

Dockerfile needs minor modifications to run #1167

Open erlingrj opened 2 years ago

erlingrj commented 2 years ago

To get the Dockerfile to run on a simple HelloWorld I had to change the first part of the generated Dockerfile from

WORKDIR /lingua-franca/HelloDocker
RUN set -ex && apk add --no-cache gcc musl-dev cmake make
COPY . src-gen
RUN set -ex && \
mkdir bin && \
cmake -S src-gen -B bin && \
cd bin && \
make all

to

WORKDIR /lingua-franca/HelloDocker
RUN set -ex && apk add --no-cache gcc musl-dev cmake make
COPY src-gen src-gen
RUN set -ex && \
mkdir bin && \
cmake -S src-gen/HelloDocker -B bin && \
cd bin && \
make all

I.e. 2 issues.

  1. Dockerfile seems to assume that you are running "docker build" from within the src-gen directory.
  2. Dockerfile is not aware that the generated src files are put in src-gen/HelloDocker/*
Soroosh129 commented 2 years ago

Would you like to tackle this issue? This is the place where the contents of the Dockerfile you posted get generated.

erlingrj commented 2 years ago

Another better(?) solution would be to just change the documentation a little and specify that you must navigate into the src-gen folder to where .Dockerfile resides before executing "docker build".

erlingrj commented 2 years ago

See https://github.com/lf-lang/website-lingua-franca/pull/65

lhstrh commented 2 years ago

Looks OK to me... Any other opinions on this? @Soroosh129 or @petervdonovan?

Soroosh129 commented 2 years ago

I think it is still unclear from the doc where this src-gen folder is. Perhaps it could link to this to clarify where the src-gen directory would be.

erlingrj commented 2 years ago

Add hyperlink to that section now https://github.com/lf-lang/website-lingua-franca/pull/65