CircleCI-Public / cimg-node

The CircleCI Node.js Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/node
MIT License
41 stars 33 forks source link

Migrating from circleci/node:16.13-browsers to cimg/node:16-13 #315

Closed bruno-salapic closed 1 year ago

bruno-salapic commented 1 year ago

Good Afternoon,

I'm forced to migrate the setup we have which is using circleci/node:16-13-browsers as base to create my docker container to cimg/node-16-13. all the documentation I have found are telling me to use orbs. the problem I'm trying to figure out though is am I able to use these orbs without creating a circleci account. like I didn't have to use the circleci dashboard to do any of this, I was just using a static image runs tests against.

is there any docs on how to use the circleci orbs and not have to make an account?

michmerr commented 1 year ago

I'm wondering the same thing. What's the point of a browsers convenience image with no pre-installed browsers?

bruno-salapic commented 1 year ago

i figured out a way that doesnt involve using the circleci, pretty much looks like this

FROM node:18 AS browsers

RUN apt-get update && \

Google Chrome deps

# Some of these packages should be pulled into their own section
 apt-get install -y --no-install-recommends --no-upgrade \
    fonts-liberation \
    libappindicator3-1 \
    libasound2 \
    libatk-bridge2.0-0 \
    libatspi2.0-0 \
    libcairo2 \
    libcups2 \
    libu2f-udev \
    libgbm1 \
    libgdk-pixbuf2.0-0 \
    libgtk-3-0 \
    libpango-1.0-0 \
    libpangocairo-1.0-0 \
    libxcursor1 \
    libxss1 \
    xdg-utils \
    libnspr4 \
    libnss3 \
    libvulkan1 \
    xvfb \
&& \
rm -rf /var/lib/apt/lists/*

RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt-get install -y ./google-chrome-stable_current_amd64.deb RUN rm google-chrome-stable_current_amd64.deb

RUN echo "Chrome: " && google-chrome --version

RUN echo 'alias chrome="/runner/framework/google-chrome"' >> ~/.bashrc

ENV DISPLAY=":99" RUN printf '#!/bin/sh\nXvfb :99 -screen 0 1280x1024x24 &\nexec "$@"\n' > /tmp/entrypoint && \ chmod +x /tmp/entrypoint && \ mv /tmp/entrypoint /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["/bin/sh"]

FROM browsers AS final

rest of the docker container stuff you want to execute goes here