Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Dockerfile parsing error when # appears in quotes - redis:5.0 Dockerfile fails to build with makisu #287

Open
rgeary1 opened this issue Oct 26, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@rgeary1
Copy link

rgeary1 commented Oct 26, 2019

Describe the bug
Building the redis:5.0 image succeeds with docker build, fails with makisu.
Looks like a Dockerfile parsing error

Error message :

a-certificates          wget                            gcc             libc6-dev               make    ;       rm -rf /var/lib/apt/lists/*;            wget -O redis.tar.gz "http://download.redis.
io/releases/redis-5.0.6.tar.gz";        echo "6624841267e142c5d5d5be292d705f8fb6070677687c5aad1645421a936d22b3 *redis.tar.gz" | sha256sum -c -;         mkdir -p /usr/src/redis;        tar -xzf red
is.tar.gz -C /usr/src/redis --strip-components=1;       rm redis.tar.gz;                grep -q '^  (c8fc8ee1)                                                                                      
1.572061455198217e+09   error   Command exited with 2                                                                                                                                               
                                                                                                                                                                                                    
1.572061455198289e+09   error   sh: 1: Syntax error: Unterminated quoted string                                                                                                                     
                                                                                                                                                                                                    
1.572061455281933e+09   error   failed to execute build plan: execute stage: build stage 0: build node: do execute: execute step: cmd wait: exit status 2                                           

To Reproduce

git clone https://github.com/docker-library/redis.git
cd redis/5.0
makisu build -t redis:5.0 .

where the last line evaluates to :

docker run -i --rm --net host -v /var/run/docker.sock:/docker.sock -e DOCKER_HOST=unix:///docker.sock -v $HOME/redis/5.0:/makisu-context -v /tmp/makisu-storage:/makisu-storage makis
u:v0.1.11 build --log-fmt=console -t redis:5.0 --commit=explicit --modifyfs=true --load /makisu-context

Expected behavior
makisu build should succeed where docker build succeeds

@rgeary1
Copy link
Author

rgeary1 commented Oct 31, 2019

Appears to be caused by this line in the RUN statement, which contains a # character
grep -q '^#define CONFIG_DEFAULT_PROTECTED_MODE 1$' /usr/src/redis/src/server.h;

Simple repro :
FROM alpine
RUN echo hi;
echo hello | grep -v '^#world';
echo end

I guess that the comment parser is not aware of quotation marks

@rgeary1 rgeary1 changed the title redis:5.0 Dockerfile fails to build with makisu Dockerfile parsing error when # appears in quotes - redis:5.0 Dockerfile fails to build with makisu Oct 31, 2019
@yiranwang52 yiranwang52 added the bug Something isn't working label Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants