pandoc_resume icon indicating copy to clipboard operation
pandoc_resume copied to clipboard

docker-compose up fails

Open kckeiks opened this issue 2 years ago • 8 comments

Expected Behavior

Creates pdf and html files in output directory

Actual Behavior

Starting resume-make ... done
Attaching to resume-make
resume-make    | make: *** No targets specified and no makefile found.  Stop.
resume-make exited with code 2

Steps to reproduce the behavior

docker-compose up

OS information

Ubuntu 20.04.2

kckeiks avatar Sep 20 '21 20:09 kckeiks

Encounter the same problem when I started docker container on Mac OS 11.5.2.

The error message is

resume-make    | make: *** No targets specified and no makefile found.  Stop.
resume-make exited with code 2

It seems that the WORKDIR of pandoc/latex:2.9 image is /data. (See Image Layer Details)

However, the source code is mounted into the path /home/app/resume.

https://github.com/mszep/pandoc_resume/blob/dcdff60bcd60ab9d7b4ccf303c7c570777a0c95f/docker-compose.yml#L13

As a result, while the container is started and try to run make command in the /data path, there is no makefile found.

HarkuLi avatar Oct 03 '21 05:10 HarkuLi

same issue here

jpduyx avatar Oct 06 '21 13:10 jpduyx

for windows, I had to change the yml file to this to get it to work..

version: '2'

services:

  resume-make:
    build:
      context: .
      dockerfile: ./.docker/resume.dockerfile
    command: make
    container_name: resume-make
    image: resume-make
    volumes:
      - "C:/your_path/pandoc_resume:/data"

But there is still an error with creating a PDF file...

mkdir -p output

PANDOC_VERSION=`pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1`; \

if [ "$PANDOC_VERSION" -eq "2" ]; then \

SMART=-smart; \

else \

SMART=--smart; \

fi \


for f in markdown/*.md; do \

FILE_NAME=`basename $f | sed 's/.md//g'`; \

echo $FILE_NAME.html; \

pandoc --standalone --include-in-header styles/chmduquesne.css \

--lua-filter=pdc-links-target-blank.lua \

--from markdown --to html \

--output output/$FILE_NAME.html $f \

--metadata pagetitle=$FILE_NAME;\

done

resume.html

for f in markdown/*.md; do \

FILE_NAME=`basename $f | sed 's/.md//g'`; \

echo $FILE_NAME.pdf; \

pandoc --standalone --template styles/chmduquesne.tex \

--from markdown --to context \

--variable papersize=A4 \

--output output/$FILE_NAME.tex $f > /dev/null; \

mtxrun --path=output --result=$FILE_NAME.pdf --script context $FILE_NAME.tex > output/context_$FILE_NAME.log 2>&1; \

done

resume.pdf

mkdir -p output

PANDOC_VERSION=`pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1`; \

if [ "$PANDOC_VERSION" -eq "2" ]; then \

SMART=-smart; \

make: *** [Makefile:9: pdf] Error 127

make: *** [Makefile:9: pdf] Error 127

else \

SMART=--smart; \

fi \


for f in markdown/*.md; do \

FILE_NAME=`basename $f | sed 's/.md//g'`; \

echo $FILE_NAME.html; \

pandoc --standalone --include-in-header styles/chmduquesne.css \

--lua-filter=pdc-links-target-blank.lua \

--from markdown --to html \

--output output/$FILE_NAME.html $f \

--metadata pagetitle=$FILE_NAME;\

done

resume.html

for f in markdown/*.md; do \

FILE_NAME=`basename $f | sed 's/.md//g'`; \

echo $FILE_NAME.pdf; \

pandoc --standalone --template styles/chmduquesne.tex \

--from markdown --to context \

--variable papersize=A4 \

--output output/$FILE_NAME.tex $f > /dev/null; \

mtxrun --path=output --result=$FILE_NAME.pdf --script context $FILE_NAME.tex > output/context_$FILE_NAME.log 2>&1; \

done

resume.pdf


MrCredible avatar Oct 30 '21 06:10 MrCredible

Thanks for reporting -- I'll try to fix this as soon as I have some spare time!

mszep avatar Nov 02 '21 17:11 mszep

When I look into container with:

docker run -it --rm --entrypoint sh resume-make

Looks like the entry point files is getting placed into root, which has no Makefile

image

tcampbPPU avatar Mar 23 '22 05:03 tcampbPPU

There is no update regarding this?! One year has passed and even the mounting point hasn't been fixed, it just needs one second to edit the docker-compose file (Although I still get that Error 127 for PDF).

avarf avatar Sep 28 '22 20:09 avarf

Apologies for the delay in fixing this, should be done now!

mszep avatar Nov 17 '22 23:11 mszep

~~Still having issues with docker-compose up. On Windows 11, The entrypoint.sh can't find /home/app~~

~~EDIT 1: I had to make the following edit. I'm not sure why the entrypoint.sh includes a cd into a directory that hasn't been created. I guess it is my windows config and I don't have an *nix installation with an app user.~~

diff --git a/docker-compose.yml b/docker-compose.yml
index 29af42f..09ae346 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -7,7 +7,7 @@ services:
       context: .
       dockerfile: ./.docker/resume.dockerfile
     container_name: resume-make
-    entrypoint: /entrypoint.sh
+    entrypoint: make 
     image: resume-make
     volumes:
-      - .:/home/app/resume:z
+      - .:/data

~~EDIT 2: There is something going on with the line endings in the entrypoint.sh when it is copied to the docker container. Inside the container I had to remove ^M with vi /entrypoint.sh then I could ./entrypoint and I wouldn't receive the not found error.~~

EDIT 3: It was the line endings on Windows. I had to run the below and I was good to go.

git config --local core.autocrlf false
git reset HEAD .
git checkout -- .
docker rm -vf (docker ps -aq)
docker image rm resume-make
docker-compose up

EDIT 4: It would be helpful for Windows folks or the like to have a .gitattributes file in the repo a la this link.

* text=auto
*.sh text eol=lf
*.conf text eol=lf

mattcargile avatar Feb 28 '24 19:02 mattcargile