cypress-docker-images icon indicating copy to clipboard operation
cypress-docker-images copied to clipboard

Create a cypress/alpine minimal image

Open tobiasbueschel opened this issue 5 years ago • 17 comments

Hi 👋

Thanks a lot for all these Docker images! I noticed the discussion around image size: https://github.com/cypress-io/cypress-docker-images/pull/83 and was wondering whether there might be a chance to create a cypress Docker image based on node:alpine or node:slim?

In this way, we would have:

Image Default Description
cypress/base cypress/base:8 All system dependencies, no browsers.
cypress/browsers cypress/browsers:chrome67 All system dependencies and browser(s).
cypress/included cypress/included:3.2.0 All system dependencies and the Cypress test runner installed globally.
cypress/alpine cypress/alpine:1.0.0 All system dependencies and the Cypress test runner installed globally.

For my current use case, I'm building Cypress Docker images in my CI pipeline that are pulled onto an on-premise CentOS system. Unfortunately, the corporate VPN really slows things down, so pulling a 1GB image for 20+ deployments & tests each day takes too long :(

Knowing that Cypress needs a lot of dependencies like libgtk2.0-0 etc., we probably need to see if all of that can be achieved easily on alpine!

Before I do any work on this, it'd be great to know if anyone has looked into this already?

Thanks 🙏

tobiasbueschel avatar May 16 '19 17:05 tobiasbueschel

+1. Its good to have a small image when we run tests in our CI.

chisma avatar Jul 23 '19 12:07 chisma

+1. Would love to see this happening!

Khazl avatar Sep 25 '19 09:09 Khazl

Has anybody tried to do this yet? If so, I'd be interested how far you got.

sebinsua avatar Nov 07 '19 12:11 sebinsua

Has anybody tried to do this yet? If so, I'd be interested how far you got.

Go for it @sebinsua 🚀 Sorry, I haven't had much time in the last months, otherwise I would have started on it already.

On that note, I'd also be curious to hear @bahmutov's thoughts on this issue!

Happy Sunday ☀️

tobiasbueschel avatar Nov 10 '19 11:11 tobiasbueschel

Great idea. Is anyone working on it?

idosal avatar Nov 24 '19 13:11 idosal

This would be very nice since I am getting 1.6 GB images for pipeline and that is a lot.

archfz avatar Dec 02 '19 18:12 archfz

👍 for an Alpine image. The Debian image is large and unzipping Cypress alone takes minutes to complete.

JasonThomasData avatar Jan 02 '20 23:01 JasonThomasData

an alpine based image would be great to have. 👍

currently our cypress image is the only one we run on k8s that has vulnerabilities. And basing an image on debian is known to come with unresolved vulnerabilities: https://github.com/docker-library/buildpack-deps/issues/46

jeff-knurek avatar Jan 28 '20 15:01 jeff-knurek

I would love a smaller image as well. I think the issue is that chrome electron does not support alpine.

Romiko avatar Nov 15 '20 11:11 Romiko

Would also like to see this happen - and willing to help.

My use case is testing a web app with Firebase Emulators running in the background. For this purpose, I have an (Alpine based) firebase-ci-builder image that takes care of the emulators.

Since I want to run Cypress tests in CI as well, am in a cross roads:

  • should I make a cypress/base + JVM + Firebase Emulators image for the front end tests (likely the sensible way)
  • get Cypress running on Alpine, in which case I could expand the above custom image, by pouring Cypress on top (the right way)

akauppi avatar Jun 06 '21 16:06 akauppi

Hi everybody Any update on this?

fescobar avatar Jun 04 '22 11:06 fescobar

Hello, is there any update here?

guifeliper avatar Jun 29 '22 06:06 guifeliper

#597 introduced bullseye-slim as the current base image for all Cypress images. There is no plan currently by the Cypress team to create an alpine-based image.

admah avatar Jun 29 '22 18:06 admah

If one of your main new features is Cypress Component Testing have in mind the developers generally use small images to develop.

fescobar avatar Aug 25 '22 12:08 fescobar

The large issue here is that chrome doesn't support alpine (not sure if firefox or edge does either). As mentioned above we do use bullseye-slim and with our cypress/factory image you could further slim down the image by choosing which browsers you want to install.

I think it would be possible to make a node + cypress alpine image, but i haven't tried that combination. When making the cypress/factory docker image, i did try to go with alpine but as soon as i realized that chrome wasn't available, I went back to bullseye-slim in order to support as many browsers as possible.

I'd be open to a contribution, think docker/factory-alpine, but the maintenance costs would have to be pretty low for us to continue to support it.

mjhenkes avatar Jan 19 '23 15:01 mjhenkes

Would this project be helpful? https://github.com/Zenika/alpine-chrome ?

liam-verta avatar Apr 26 '23 16:04 liam-verta

I would love a smaller image as well. I think the issue is that chrome electron does not support alpine.

firefox seems to, which would be a start: https://pkgs.alpinelinux.org/package/edge/community/x86/firefox

SIGSTACKFAULT avatar May 09 '23 03:05 SIGSTACKFAULT