ganlanyuan / tiny-slider

Vanilla javascript slider for all purposes.
MIT License
5.25k stars 785 forks source link

Cannot build tiny-slider without Docker #565

Open Abdull opened 4 years ago

Abdull commented 4 years ago

Issue description: I would like to contribute to tiny-slider, but I'm struggling with setting up its development environment. I tried building the project without the Docker setup mentioned in CONTRIBUTING.md ( https://github.com/ganlanyuan/dockerfile ), but I couldn't figure out missing dependencies (rollup et al.) and their versions (gulp 3.x or 4.x), whether and when to use npm or yarn or gulp or bower.

Also, package-lock.json references a version of dependency commander, which doesn't exist at npm anymore.

Demo link/slider setting: N/A

Tiny-slider version: v2.9.2 Browser name && version: N/A OS name && version: Windows 10

Abdull commented 4 years ago

Trying with Docker Desktop CE Version 2.2.0.4. Executing docker-compose up results in

$ docker-compose up
ERROR: client version 1.22 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

I fixed it by editing tiny-slider's docker-compose.yml and changing version: '2' to version: '2.1'.

Next, I got the following error message

$ docker-compose up
Creating network "tiny-slider_default" with the default driver
Pulling web (cmcdev/web:2.7.3)...
2.7.3: Pulling from cmcdev/web
ERROR: image operating system "linux" cannot be used on this platform

I fixed it by changing Docker Desktop's container type: settings: Switch to Linux containers....

This first didn't work, because I had to explicitly change my computer's BIOS settings to activate Hyper-V virtualization.

After reboot, I got the following error message:

$ docker-compose up
Pulling web (cmcdev/web:2.7.3)...
ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:45445->[::1]:53: read: connection refused

I fixed this by explicitly setting Docker's DNS server to 8.8.8.8 (Docker -> Settings -> Resources -> NETWORK -> DNS Server -> Activate Manual DNS configuration -> Set it to 8.8.8.8).

Next, I got the following error message:

$ docker-compose up
Pulling web (cmcdev/web:2.7.3)...
2.7.3: Pulling from cmcdev/web
22ecafbbcc4a: Pull complete
3b5244e3179b: Pull complete
8321ffd10031: Pull complete
08b8f28a13c2: Pull complete
2b401702069a: Pull complete
a3ed95caeb02: Pull complete
eae027dcdc0e: Pull complete
93bc98227159: Pull complete
fe522c3ba554: Pull complete
a574b807f473: Pull complete
e7ce9b47cc09: Pull complete
a9272bb972c2: Pull complete
d54ed4cfe59d: Pull complete
616a145e05e5: Pull complete
a8812ddc6cee: Pull complete
c0870c27cacf: Pull complete
eb32dcd469cc: Pull complete
359b2d8bb8f6: Pull complete
Digest: sha256:856dd7325010feeb1a8b88499481c32df7dc6f3b3afa3e5150ffbd7193e278cc
Status: Downloaded newer image for cmcdev/web:2.7.3
Creating tiny-slider ... error

ERROR: for tiny-slider  Cannot create container for service web: status code not OK but 500: {"Message":"Unhandled exception: Drive has not been shared"}

ERROR: for web  Cannot create container for service web: status code not OK but 500: {"Message":"Unhandled exception: Drive has not been shared"}
ERROR: Encountered errors while bringing up the project.

I than made progress by first explicitly pulling the required image:

$ docker pull cmcdev/web

Now docker-compose up starts correctly and visiting http://localhost:3000/test/index.html#chrome

Abdull commented 4 years ago

I got the build process working without Docker, see https://github.com/Abdull/tiny-slider/tree/gesis .