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

Unable to build Dockerfile on Windows #12

Open
renemolenaar82 opened this issue Aug 31, 2018 · 5 comments
Open

Unable to build Dockerfile on Windows #12

renemolenaar82 opened this issue Aug 31, 2018 · 5 comments

Comments

@renemolenaar82
Copy link

Just tried to build one of the Dockerfiles but it fails at step 9:

C:\Users\info\Desktop\testalpine\ngx-pagespeed-alpine (master -> origin)
docker build -t ngxpagespeed-alpine38-ngxstable stable/3.8/nginx-stable
Step 8/42 : COPY patches/modpagespeed/*.patch ./
 ---> f86cfa6de5db
Step 9/42 : RUN for i in *.patch; do printf "\r\nApplying patch ${i%%.*}\r\n"; patch -p1 < $i || exit 1; done
 ---> Running in f110904dd81d

Applying patch automatic_makefile
': No such file or directory/automatic/Makefile
patching file pagespeed/automatic/Makefile
The command '/bin/sh -c for i in *.patch; do printf "\r\nApplying patch ${i%%.*}\r\n"; patch -p1 < $i || exit 1; done' returned a non-zero code: 1

Am I missing something here?

@nberlee
Copy link
Contributor

nberlee commented Aug 31, 2018

Ok, it still works for me on Linux. This does not help you, so please provide me with the output docker info so I can try it in a Windows VM.

Also, please try again with --no-cache, it is possible something when wrong with the git clone and git did not fail with exit code > 0

@nberlee
Copy link
Contributor

nberlee commented Aug 31, 2018

And the ouput of docker run --rm -t f86cfa6de5db ls pagespeed -l would confirm that last theory. So it would be really great of you would run that aswell. It just takes the state of the docker image after step 8 and runs a ls of the pagespeed directory.

@renemolenaar82
Copy link
Author

I just did a new run with --no-cache. Here's the output:

docker run --rm -t f86cfa6de5db ls pagespeed -lh
total 60
drwxr-xr-x    3 root     root        4.0K Aug 31 17:29 apache
drwxr-xr-x    3 root     root        4.0K Aug 31 17:29 automatic
drwxr-xr-x    2 root     root        4.0K Aug 31 17:29 controller
-rw-r--r--    1 root     root        2.8K Aug 31 17:29 controller.gyp
drwxr-xr-x   11 root     root        4.0K Aug 31 17:29 kernel
-rw-r--r--    1 root     root       22.3K Aug 31 17:29 kernel.gyp
drwxr-xr-x    5 root     root        4.0K Aug 31 17:29 opt
-rw-r--r--    1 root     root        4.7K Aug 31 17:29 opt.gyp
drwxr-xr-x    3 root     root        4.0K Aug 31 17:29 system
docker run --rm -t f86cfa6de5db ls pagespeed/automatic -l
total 416
-rw-r--r--    1 root     root         12538 Aug 31 17:29 Makefile
-rw-r--r--    1 root     root          2555 Aug 31 17:29 html_detector.cc
-rw-r--r--    1 root     root          3319 Aug 31 17:29 html_detector.h
-rw-r--r--    1 root     root          3989 Aug 31 17:29 html_detector_test.cc
-rwxr-xr-x    1 root     root          1640 Aug 31 17:29 merge_libraries.sh
-rw-r--r--    1 root     root         52370 Aug 31 17:29 proxy_fetch.cc
-rw-r--r--    1 root     root         20819 Aug 31 17:29 proxy_fetch.h
-rw-r--r--    1 root     root         29456 Aug 31 17:29 proxy_fetch_test.cc
-rw-r--r--    1 root     root         16155 Aug 31 17:29 proxy_interface.cc
-rw-r--r--    1 root     root          4825 Aug 31 17:29 proxy_interface.h
-rw-r--r--    1 root     root        150892 Aug 31 17:29 proxy_interface_test.cc
-rw-r--r--    1 root     root         16264 Aug 31 17:29 proxy_interface_test_base.cc
-rw-r--r--    1 root     root          9139 Aug 31 17:29 proxy_interface_test_base.h
-rwxr-xr-x    1 root     root          2379 Aug 31 17:29 rename_c_symbols.sh
-rw-r--r--    1 root     root          4395 Aug 31 17:29 rewriter_speed_test.cc
-rw-r--r--    1 root     root          8681 Aug 31 17:29 static_rewriter.cc
-rw-r--r--    1 root     root          3408 Aug 31 17:29 static_rewriter.h
-rw-r--r--    1 root     root          3739 Aug 31 17:29 static_rewriter_main.cc
-rwxr-xr-x    1 root     root          3817 Aug 31 17:29 system_test.sh
-rw-r--r--    1 root     root         36271 Aug 31 17:29 system_test_helpers.sh
drwxr-xr-x    2 root     root          4096 Aug 31 17:29 system_tests

It seems to be there.

docker info
Containers: 189
 Running: 1
 Paused: 0
 Stopped: 188
Images: 521
Server Version: 18.06.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d648912
ID: F6T6:UEL5:5ZTE:EFRR:KZYD:6DTL:PJHT:KPTQ:QDIX:PVAJ:BV4H:2E4F
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 22
 Goroutines: 47
 System Time: 2018-09-01T06:42:32.0627179Z
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

First time I run into an issue building an image on Windows. I'll try it on Linux now.

@renemolenaar82 renemolenaar82 changed the title Unable to build Dockerfile Unable to build Dockerfile on Windows Sep 5, 2018
@nberlee
Copy link
Contributor

nberlee commented Sep 24, 2018

I am sorry, I seem to unable to test it, I cannot seem to run Docker for Windows from a VM in VMware Workstation, even though I think I got nested HyperV which is a requirement working.

from the error the patch seems to fail, therefor exiting the for loop and giving back a error level 1. Now I really don't understand why the patch would fail. If you would still try to solve it, I would recommend setting exprimental: false and Debug Mode (server) also to false if that is even possible in Docker for Windows.

If that doesn't help, try switching from overlay2 to overlay as you might be stumbling on a NTFS <-> overlay2 problem. I am sorry I could not successfull test this all myself.

@renemolenaar82
Copy link
Author

Hello Nico,

No problem! It's not much of an issue since I can build it on Linux just fine. It's the first time I ran into an issue like this on Windows so I was a bit surprised. Feel free to close this if you want.

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

2 participants