{"id":26984251,"url":"https://github.com/friendsofshopware/platform-plugin-dev-docker","last_synced_at":"2025-10-03T21:07:32.454Z","repository":{"id":38380724,"uuid":"297418441","full_name":"FriendsOfShopware/platform-plugin-dev-docker","owner":"FriendsOfShopware","description":"Docker image containing useful stuff for plugin development","archived":false,"fork":false,"pushed_at":"2025-03-18T23:26:21.000Z","size":155,"stargazers_count":24,"open_issues_count":7,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T23:29:29.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendsOfShopware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-21T17:53:36.000Z","updated_at":"2025-03-18T23:26:24.000Z","dependencies_parsed_at":"2023-02-13T00:31:01.865Z","dependency_job_id":"3b573796-01c4-4370-a2f0-1c31cc7e97b8","html_url":"https://github.com/FriendsOfShopware/platform-plugin-dev-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fplatform-plugin-dev-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fplatform-plugin-dev-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fplatform-plugin-dev-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendsOfShopware%2Fplatform-plugin-dev-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendsOfShopware","download_url":"https://codeload.github.com/FriendsOfShopware/platform-plugin-dev-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247049729,"owners_count":20875301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-03T17:35:51.202Z","updated_at":"2025-10-03T21:07:27.400Z","avatar_url":"https://github.com/FriendsOfShopware.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\n\nA docker image with preinstalled Shopware 6, without a webserver, but including some helper tools. These images are meant to be useful for debugging Shopware plugins or running plugin tasks in CI with different Shopware versions.\n\n# Available Docker image tags\n\nWe provide a tag for each [minor Shopware 6 release](https://www.shopware.com/en/news/shopware-6-versioning-strategy/), which should always point to the latest patch release. Additionally there exist a tag for each major branch. A list of available tags can be found [here](https://github.com/FriendsOfShopware/platform-plugin-dev-docker/pkgs/container/platform-plugin-dev/versions?filters%5Bversion_type%5D=tagged).\n\n# Available scripts and commands\n\nInside the Docker container you can use the following commands\n\n## `plugin-uploader`\n\nFor more information see the [offical documentation](https://github.com/FriendsOfShopware/FroshPluginUploader#using-the-commands) of the plugin uploader.\n\n## `start-mysql`\n\nSimple script which will start the mysql server and return `0` if it was successfully started.\n\n## `pack-plugin \u003cplugin name\u003e`\n\nThis command will install the plugin with `\u003cplugin name\u003e` and compile all JavaScript files needed for the storefront and the administration.\nIf the environment variable `SHOPWARE_ROOT` is set, this will be used as alternative Shopware location, otherwise if this variable is empty, the default Shopware setup from this image `/opt/shopware` will be used.\n\nMake sure that the plugin folder is present in `${SHOPWARE_ROOT}/custom/plugins/`. If you use the default `SHOPWARE_ROOT` you can place them in `/plugins`.\n\n## `pack-app \u003capp name\u003e`\n\nThis command will install the app with `\u003capp name\u003e` and compile all JavaScript files needed for the storefront.\nIf the environment variable `SHOPWARE_ROOT` is set, this will be used as alternative Shopware location, otherwise if this variable is empty, the default Shopware setup from this image `/opt/shopware` will be used.\n\nMake sure that the app folder is present in `${SHOPWARE_ROOT}/custom/apps/`. If you use the default `SHOPWARE_ROOT` you can place them in `/apps`.\n\n# Build Docker image for specific Shopware version\n\nIt is possible to specify the Shopware version or even the template with the Docker option `--build-arg`, e.g.:\n```\ndocker build --build-arg SHOPWARE_VERSION=trunk . -t platform-plugin-dev:trunk\n```\n\nIn the same way it is also possible to specify the template Git repository URL:\n```\ndocker build --build-arg SHOPWARE_VERSION=trunk \\\n    --build-arg TEMPLATE_REPOSITORY='https://github.com/FriendsOfShopware/platform' \\\n    . -t platform-plugin-dev:trunk\n```\n\n\n# Examples\n## Pack Plugin in .gitlab-ci.yml\n```yaml\nbuild:pack-plugin:\n  image:\n    name: ghcr.io/friendsofshopware/platform-plugin-dev:v6.5.0\n    entrypoint: [\"\"]\n  script:\n    - ln -s \"$(pwd)\" \"/plugins/${CI_PROJECT_NAME}\"\n    - pack-plugin \"${CI_PROJECT_NAME}\"\n    - plugin-uploader ext:validate \"$(realpath \"${CI_PROJECT_NAME}.zip\")\"\n  artifacts:\n    paths:\n      - \"${CI_PROJECT_NAME}.zip\"\n    expire_in: 1 week\n```\n\n## Pack App in .gitlab-ci.yml\n```yaml\nbuild:pack-app:\n  image:\n    name: ghcr.io/friendsofshopware/platform-plugin-dev:v6.5.0\n    entrypoint: [\"\"]\n  script:\n    - start-mysql\n    - ln -s \"$(pwd)\" \"/apps/${CI_PROJECT_NAME}\"\n    - rm -rf \"/apps/${CI_PROJECT_NAME}/store\" # Remove the store folder manually since it is not removed in the pack process for apps\n    - pack-app \"${CI_PROJECT_NAME}\"\n    - plugin-uploader ext:validate \"$(realpath \"${CI_PROJECT_NAME}.zip\")\" || true\n  artifacts:\n    paths:\n      - \"${CI_PROJECT_NAME}.zip\"\n    expire_in: 1 week\n```\n\n## PHPUnit tests\nThe docker images contains `phpunit` constrained via the Shopware `composer.json`. Additionally a `TestBootstrapper` is included, either the one from the Shopware repository or a fallback one for Shopware versions `\u003c 6.4.5.0`. This can be utilized inside your plugin (e.g. in `tests/TestBootstrap.php`)\n```php\n\u003c?php declare(strict_types=1);\n\nuse Shopware\\Core\\TestBootstrapper;\n\n$testBootstrapper = null;\nif (is_readable('/opt/share/shopware/tests/TestBootstrapper.php')) {\n    // For Docker image: ghcr.io/friendsofshopware/platform-plugin-dev\n    $testBootstrapper = require '/opt/share/shopware/tests/TestBootstrapper.php';\n} else {\n    // Create your own TestBootstrapper\n}\n\nreturn $testBootstrapper\n    -\u003esetLoadEnvFile(true)\n    -\u003esetForceInstallPlugins(true)\n    -\u003eaddActivePlugins('MyTechnicalPluginName')\n    -\u003ebootstrap()\n    -\u003egetClassLoader()\n;\n```\n\nThe associate `phpunit.xml.dist` would than look something like\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cphpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:noNamespaceSchemaLocation=\"https://schema.phpunit.de/9.3/phpunit.xsd\"\n         backupGlobals=\"false\"\n         colors=\"true\"\n         bootstrap=\"tests/TestBootstrap.php\"\n         cacheResult=\"false\"\u003e\n    \u003ccoverage processUncoveredFiles=\"true\"\u003e\n        \u003cinclude\u003e\n            \u003cdirectory suffix=\".php\"\u003esrc\u003c/directory\u003e\n        \u003c/include\u003e\n    \u003c/coverage\u003e\n    \u003cphp\u003e\n        \u003cini name=\"error_reporting\" value=\"-1\"/\u003e\n        \u003cserver name=\"APP_ENV\" value=\"test\" force=\"true\"/\u003e\n        \u003cenv name=\"APP_DEBUG\" value=\"1\"/\u003e\n        \u003cenv name=\"APP_SECRET\" value=\"s$cretf0rt3st\"/\u003e\n        \u003cenv name=\"SHELL_VERBOSITY\" value=\"-1\"/\u003e\n        \u003cenv name=\"SYMFONY_DEPRECATIONS_HELPER\" value=\"disabled\" /\u003e\n    \u003c/php\u003e\n    \u003ctestsuites\u003e\n        \u003ctestsuite name=\"MyTechnicalPluginName\"\u003e\n            \u003cdirectory\u003etests\u003c/directory\u003e\n        \u003c/testsuite\u003e\n    \u003c/testsuites\u003e\n\u003c/phpunit\u003e\n```\n\nLocally execute the tests using the provided docker images, assuming you are currently inside the plugin directory\n```\ndocker run --rm -it -v \"${PWD}:/plugins/MyTechnicalPluginName\" ghcr.io/friendsofshopware/platform-plugin-dev:v6.4.0 sh -c 'start-mysql \u0026\u0026 cd /plugins/MyTechnicalPluginName \u0026\u0026 phpunit'\n```\n\n## Run the tests in .gitlab-ci.yml\n```yaml\ntest:phpunit:\n  stage: test\n  image:\n    name: ghcr.io/friendsofshopware/platform-plugin-dev:${SHOPWARE_VERSION}\n    entrypoint: [\"\"]\n  script:\n    - start-mysql\n    - ln -s \"$(pwd)\" \"/plugins/${CI_PROJECT_NAME}\"\n    - phpunit\n  parallel:\n    matrix:\n      - SHOPWARE_VERSION: ['v6.4.0', 'v6.4.5', 'v6.4.10', 'v6.4.15']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofshopware%2Fplatform-plugin-dev-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendsofshopware%2Fplatform-plugin-dev-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofshopware%2Fplatform-plugin-dev-docker/lists"}