Docker-compose exits due to invalid plugin in cypress docker-image #20810
              
                
                  
                  
                    Answered
                  
                  by
                    filipe-costa
                  
              
          
                  
                    
                      filipe-costa
                    
                  
                
                  asked this question in
                Docker
              
            -
| I have the following docker file to which I am extending the current cypress image to be able to install a plugin: FROM cypress/included:9.4.1
COPY cypress.json .
COPY cypress ./cypress
RUN npm install -g cypress-image-snapshotand the following docker-compose: version: '3.2'
services:
 ...other services...
 
  service-e2e:
    image: service-e2e
    container_name: service-e2e
    command:
      - npx cypress run --headless
    depends_on:
      - service_clientI have installed the plugin globally: and the plugin file: /// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
/**
 * @type {Cypress.PluginConfig}
 */
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
  // `on` is used to hook into various events Cypress emits
  // `config` is the resolved Cypress config
  addMatchImageSnapshotPlugin(on, config);
}Which ends up throwing the following error: Is there anything else besides cypress and the plugin I need to have to successfully execute this within docker/docker-compose? | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            filipe-costa
          
      
      
        Mar 28, 2022 
      
    
    Replies: 1 comment
-
| It works using the following: FROM cypress/included:9.4.1
WORKDIR /e2e
COPY cypress.json .
COPY cypress ./cypress
RUN npm install cypress-image-snapshot | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        filipe-costa
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
It works using the following: