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

docker-compose up fails #79

Open
kckeiks opened this issue Sep 20, 2021 · 8 comments
Open

docker-compose up fails #79

kckeiks opened this issue Sep 20, 2021 · 8 comments

Comments

@kckeiks
Copy link

kckeiks commented Sep 20, 2021

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

@HarkuLi
Copy link

HarkuLi commented Oct 3, 2021

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.

- .:/home/app/resume

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

@jpduyx
Copy link

jpduyx commented Oct 6, 2021

same issue here

@MrCredible
Copy link

MrCredible commented Oct 30, 2021

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


@mszep
Copy link
Owner

mszep commented Nov 2, 2021

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

@tcampbPPU
Copy link

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

@avarf
Copy link

avarf commented Sep 28, 2022

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).

@mszep
Copy link
Owner

mszep commented Nov 17, 2022

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

@mattcargile
Copy link

mattcargile commented Feb 28, 2024

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

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

8 participants