专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

markoshust/magento-elasticsearch Docker 镜像 - 轩辕镜像

magento-elasticsearch
markoshust/magento-elasticsearch
Elasticsearch images for Magento 1 and Magento 2
7 收藏0 次下载
⚠️ 线上容器拉取慢、不稳定?拉镜像别再赌运气
镜像简介版本下载
⚠️ 线上容器拉取慢、不稳定?拉镜像别再赌运气

markshust/docker-magento

Mark Shust's Docker Configuration for Magento

Table of contents

  • Free Course
  • Docker Hub
  • Usage
  • Prerequisites
  • Setup
  • Updates
  • Custom CLI Commands
  • Misc Info
  • Credits
  • License

Free Course

This course is sponsored by M.academy. Level up your Magento 2 skills with a collection of resources including lessons, courses & more.

A free screencast course is available, which details the basic usage of this project:



Setup a Magento 2 Development Environment with Docker
Course Curriculm
Project Setup
  • Setup Docker for Mac & configure preferences
  • Setup global Composer auth credentials
  • Automated setup for new installs
Helper Scripts
  • Run CLI commands within containers
  • Stop, start & restart containers
  • Run binaries within containers
Docker Filesystem & Volumes
  • Understand volumes & host bind mounts
  • Manage files & folders on containers
Customize Server Configuration
  • Customize the Nginx configuration
  • Quickly switch PHP versions
  • Install extensions & packages
  • Run additional services as containers
  • Configure multi-store instances
PHPStorm & Xdebug
  • Setup PHPStorm for a Magento Docker project
  • Generate XML URNs for a Magento Docker project
  • Install Xdebug browser plugin
  • Enable, disable, & check Xdebug
  • Configure PHPStorm for Xdebug
  • Trigger Xdebug breakpoints with PHPStorm
Manual Setup (Optional)
  • Manual setup for new Magento installs
  • Manual setup for an existing Magento instance

Docker Hub

View Dockerfiles:

  • markoshust/magento-nginx (Docker Hub)
    • 1.18
      • 1.18, 1.18-4
      • 1.18-3
      • 1.18-2
      • 1.18-1
      • 1.18-0
  • markoshust/magento-php (Docker Hub)
    • 8.0 (available for alpha testing)
      • 8.0-fpm-develop
    • 7.4
      • 7.4-fpm, 7.4-fpm-3
      • 7.4-fpm-2
      • 7.4-fpm-1
      • 7.4-fpm-0
    • 7.3
      • 7.3-fpm, 7.3-fpm-10
      • 7.3-fpm-9
      • 7.3-fpm-8
      • 7.3-fpm-7
      • 7.3-fpm-6
      • 7.3-fpm-5
      • 7.3-fpm-4
      • 7.3-fpm-3
      • 7.3-fpm-2
      • 7.3-fpm-1
      • 7.3-fpm-0
  • markoshust/magento-elasticsearch (Docker Hub)
    • 7
      • 7.7, 7.7.1-0
      • 7.6, 7.6.2-2
      • 7.6.2-1
      • 7.6.2-0

Usage

This configuration is intended to be used as a Docker-based development environment for Magento 2.

Folders:

  • images: Docker images for nginx and php
  • compose: sample setups with Docker Compose

The Magento 1 version of this development environment has been deprecated and is no longer supported. PHP 5 was used as it's base, and that version has reached end-of-life. If you still wish to use this setup, please reference compose/magento-1 on tag 20.1.1, but please be aware these images are no longer maintained.

Prerequisites

This setup assumes you are running Docker on a computer with at least 4GB of allocated RAM, a dual-core, and an SSD hard drive. Download & Install Docker Desktop.

This configuration has been tested on Mac & Linux. Windows is supported through the use of Docker on WSL.

Setup

Automated Setup (New Project)

Run this automated one-liner from the directory you want to install your project.

No sample data
bash
curl -s [***] | bash -s -- magento2.test 2.4.1
With sample data
bash
curl -s [***] | bash -s -- magento2.test with-samples-2.4.1

The magento2.test above defines the hostname to use, and the 2.4.1 defines the Magento version to install. Note that since we need a write to /etc/hosts for DNS resolution, you will be prompted for your system password during setup.

Prefix the version with with-samples- if you would like to automatically install sample data along with Magento.

After the one-liner above completes running, you should be able to access your site at [***].

Manual Setup

Same result as the one-liner above. Just replace magento2.test references with the hostname that you wish to use.

New Projects
bash
# Download the Docker Compose template:
curl -s [***] | bash

# Download the version of Magento you want to use with:
bin/download 2.4.1

# If the download fails, the script will attempt to download Magento with Composer

# or if you'd rather install with Composer, run:
#
# OPEN SOURCE:
#
# rm -rf src
# composer create-project --repository=[***] --ignore-platform-reqs --prefer-dist magento/project-community-edition=2.4.1 src
#
# COMMERCE:
#
# rm -rf src
# composer create-project --repository=[***] --ignore-platform-reqs --prefer-dist magento/project-enterprise-edition=2.4.1 src

# Create a DNS host entry for the site:
echo "127.0.0.1 ::1 magento2.test" | sudo tee -a /etc/hosts

# Run the setup installer for Magento:
bin/setup magento2.test

open [***]
Existing Projects
bash
# Download the Docker Compose template:
curl -s [***] | bash

# Replace with existing source code of your existing Magento instance:
cp -R ~/Sites/existing src
# or: git clone ***:myrepo.git src

# Create a DNS host entry for the site:
echo "127.0.0.1 ::1 yoursite.test" | sudo tee -a /etc/hosts

# Start some containers, copy files to them and then restart the containers:
docker-compose up -d
rm -rf src/vendor
bin/copytocontainer --all ## Initial copy will take a few minutes...

# Install composer dependencies, then copy artifacts back to the host (for debugging purposes):
bin/composer install
bin/copyfromcontainer vendor

# Import existing database:
bin/mysql < backups/magento.sql

# Update database connection details to use the above Docker MySQL credentials:
# Also note: creds for the MySQL server are defined at startup from env/db.env
# vi src/app/etc/env.php

# Import app-specific environment settings:
bin/magento app:config:import

# Set base URLs to local environment URL (if not defined in env.php file):
bin/magento config:set web/secure/base_url [***]
bin/magento config:set web/unsecure/base_url [***]

bin/restart

open [***]

For more details on how everything works, see the extended setup readme.

Updates

To update your project to the latest version of docker-magento, run:

bin/update

We recommend keeping your docker config files in version control, so you can monitor the changes to files after updates. After reviewing the code updates and ensuring they updated as intended, run bin/restart to restart your containers to have the new configuration take effect.

It is recommended to keep your root docker config files in one repository, and your Magento code setup in another. This ensures the Magento base path lives at the top of one specific repository, which makes automated build pipelines and deployments easy to manage, and maintains compatibility with projects such as Magento Cloud.

Custom CLI Commands

  • bin/bash: Drop into the bash prompt of your Docker container. The phpfpm container should be mainly used to access the filesystem within Docker.
  • bin/cache-clean: Access the cache-clean CLI. Note the watcher is automatically started at startup in bin/start. Ex. bin/cache-clean config full_page
  • bin/cli: Run any CLI command without going into the bash prompt. Ex. bin/cli ls
  • bin/clinotty: Run any CLI command with no TTY. Ex. bin/clinotty chmod u+x bin/magento
  • bin/cliq: The same as bin/cli, but pipes all output to /dev/null. Useful for a quiet CLI, or implementing long-running processes.
  • bin/composer: Run the composer binary. Ex. bin/composer install
  • bin/copyfromcontainer: Copy folders or files from container to host. Ex. bin/copyfromcontainer vendor
  • bin/copytocontainer: Copy folders or files from host to container. Ex. bin/copytocontainer --all
  • bin/dev-urn-catalog-generate: Generate URN's for PHPStorm and remap paths to local host. Restart PHPStorm after running this command.
  • bin/devconsole: Alias for bin/n98-magerun2 dev:console
  • bin/devtools-cli-check: Check & install the CLI devtools if missing from system.
  • bin/download: Download & extract specific Magento version to the src directory. If the archive download fails, it will attempt to download with Composer. Ex. bin/download 2.4.1
  • bin/fixowns: This will fix filesystem ownerships within the container.
  • bin/fixperms: This will fix filesystem permissions within the container.
  • bin/grunt: Run the grunt binary. Ex. bin/grunt exec
  • bin/magento: Run the Magento CLI. Ex: bin/magento cache:flush
  • bin/mysql: Run the MySQL CLI with database config from env/db.env. Ex. bin/mysql -e "EXPLAIN core_config_data" orbin/mysql < backups/magento.sql
  • bin/mysqldump: Backup the Magento database. Ex. bin/mysqldump > backups/magento.sql
  • bin/n98-magerun2: Access the n98-magerun2 CLI. Ex: bin/n98-magerun2 dev:console
  • bin/node: Run the node binary. Ex. bin/node --version
  • bin/npm: Run the npm binary. Ex. bin/npm install
  • bin/pwa-studio: (BETA) Start the PWA Studio server. Note that Chrome will throw SSL cert errors and not allow you to view the site, but Firefox will.
  • bin/redis: Run a command from the redis container. Ex. bin/redis redis-cli monitor
  • bin/remove: Remove all containers.
  • bin/removeall: Remove all containers, networks, volumes, and images.
  • bin/removevolumes: Remove all volumes.
  • bin/restart: Stop and then start all containers.
  • bin/root: Run any CLI command as root without going into the bash prompt. Ex bin/root apt-get install nano
  • bin/rootnotty: Run any CLI command as root with no TTY. Ex bin/rootnotty chown -R app:app /var/www/html
  • bin/setup: Run the Magento setup process to install Magento from the source code, with optional domain name. Defaults to magento2.test. Ex. bin/setup magento2.test
  • bin/setup-grunt: Install and configure Grunt JavaScript task runner to compile .less files
  • bin/setup-pwa-studio: (BETA) Install PWA Studio (requires NodeJS and Yarn to be installed on the host machine). Pass in your base site domain, otherwise the default master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud will be used. Ex: bin/setup-pwa-studio magento2.test
  • bin/setup-ssl: Generate an SSL certificate for one or more domains. Ex. bin/setup-ssl magento2.test magento3.test
  • bin/setup-ssl-ca: Generate a certificate authority and copy it to the host.
  • bin/start: Start all containers, good practice to use this instead of docker-compose up -d, as it may contain additional helpers.
  • bin/status: Check the container status.
  • bin/stop: Stop all containers.
  • bin/update: Update your project to the most recent version of docker-magento.
  • bin/xdebug: Disable or enable Xdebug. Accepts params disable (default) or enable. Ex. bin/xdebug enable

Misc Info

Caching

For an improved developer experience, caches are automatically refreshed when related files are updated, courtesy of cache-clean. This means you can keep all of the standard Magento caches enabled, and this script will only clear the specific caches needed, and only when necessary.

To disable this functionality, uncomment the last line in the bin/start file to disable the watcher.

Database

The hostname of each service is the name of the service within the docker-compose.yml file. So for example, MySQL's hostname is db (not localhost) when accessing it from within a Docker container. Elasticsearch's hostname is elasticsearch.

To connect to the MySQL CLI tool of the Docker instance, run:

bin/mysql

You can use the bin/mysql script to import a database, for example a file stored in your local host directory at backups/magento.sql:

bin/mysql < backups/magento.sql

You also can use bin/mysqldump to export the database. The file will appear in your local host directory at backups/magento.sql:

bin/mysqldump > backups/magento.sql
Composer Authentication

First setup Magento Marketplace authentication (details in the DevDocs).

Copy src/auth.json.sample to src/auth.json. Then, update the username and password values with your Magento public and private keys, respectively. Finally, copy the file to the container by running bin/copytocontainer auth.json.

Email / Mailhog

View emails sent locally through Mailhog by visiting http://{yourdomain}:8025

Redis

Redis is now the default cache and session storage engine, and is automatically configured & enabled when running bin/setup on new installs.

Use the following lines to enable Redis on existing installs:

Enable for Cache:

bin/magento config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0

Enable for Full Page Cache:

bin/magento config:set --page-cache=redis --page-cache-redis-server=redis --page-cache-redis-db=1

Enable for Session:

bin/magento config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=2

You may also monitor Redis by running: bin/redis redis-cli monitor

For more information about Redis usage with Magento, see the DevDocs.

Xdebug & VS Code

Install and enable the PHP Debug extension from the Visual Studio Marketplace.

Otherwise, this project now automatically sets up Xdebug support with VS Code. If you wish to set this up manually, please see the .vscode/launch.json file.

Xdebug & PHPStorm
  1. First, install the Chrome Xdebug helper. After installed, right click on the Chrome icon for it and go to Options. Under IDE Key, select PHPStorm from the list and click Save.

  2. Next, enable Xdebug in the PHP-FPM container by running: bin/xdebug enable, the restart the docker containers (CTRL+C then bin/start).

  3. Then, open PHPStorm > Preferences > Languages & Frameworks > PHP and configure:

    • CLI Interpreter

      • Create a new interpreter and specify From Docker, and name it markoshust/magento-php:7-2-fpm.
      • Choose Docker, then select the markoshust/magento-php:7-2-fpm image name, and set the PHP Executable to php.
    • Path mappings

      • Don't do anything here as the next Docker container step will automatically setup a path mapping from /var/www/html to ./src.
    • Docker container

      • Remove any pre-existing volume bindings.
      • Ensure a volume binding has been setup for Container path of /var/www/html mapped to the Host path of ./src.
  4. Open PHPStorm > Preferences > Languages & Frameworks > PHP > Debug and set Debug Port to 9001.

  5. Open PHPStorm > Preferences > Languages & Frameworks > PHP > DBGp Proxy and set Port to 9001.

  6. Open PHPStorm > Preferences > Languages & Frameworks > PHP > Servers and create a new server:

    • Set Name and Host to your domain name (ex. magento2.test)
    • Keep port set to 80
    • Check the Path Mappings box and map src to the absolute path of /var/www/html
  7. Go to Run > Edit Configurations and create a new PHP Remote Debug configuration by clicking the plus sign and selecting it. Set the Name to your domain (ex. magento2.test). Check the Filter debug connection by IDE key checkbox, select the server you just setup, and under IDE Key enter PHPSTORM. This IDE Key should match the IDE Key set by the Chrome Xdebug Helper. Then click OK to finish setting up the remote debugger in PHPStorm.

  8. Open up src/pub/index.php, and set a breakpoint near the end of the file. Go to Run > Debug 'magento2.test', and open up a web browser. Ensure the Chrome Xdebug helper is enabled by clicking on it > Debug. Navigate to your Magento store URL, and Xdebug within PHPStorm should now trigger the debugger and pause at the toggled breakpoint.

Linux

Running Docker on Linux should be pretty straight-forward. Note that you need to run some post install commands as well as installing Docker Compose. These steps are taken care of automatically with Docker Desktop, but not on Linux.

Be sure to see the "Linux only" documentation in the docker-compose.dev.yml file. The extra_hosts param is required to be defined on Linux for proper DNS resolution.

You may also have to increase a virtual memory map count on the host system. It is required by Elasticsearch.

Add following line to /etc/sysctl.conf:

vm.max_map_count=262144

To enable Xdebug on linux, you'll also need to open port 9001 on the firewall with:

sudo iptables -A INPUT -p tcp --dport 9001 -j ACCEPT
Blackfire.io

These docker images have built-in support for Blackfire.io. To use it, first register your server ID and token with the Blackfire agent:

bin/root blackfire-agent --register --server-id={YOUR_SERVER_ID} --server-token={YOUR_SERVER_TOKEN}

Next, open up the bin/start helper script and uncomment the line:

#bin/root /etc/init.d/blackfire-agent start

Finally, restart the containers with bin/restart. After doing so, everything is now configured and you can use a browser extension to profile your Magento store with Blackfire.

Credits

M.academy

This course is sponsored by M.academy, which offers lessons and cours

查看更多 magento-elasticsearch 相关镜像 →
elasticsearch logo
elasticsearch
Elasticsearch是一款功能强大的开源搜索与分析引擎,它基于Lucene构建,具备分布式、高扩展、实时处理的特性,能够高效存储、检索和分析各类结构化与非结构化数据,广泛应用于日志分析、全文搜索、业务智能等场景,通过简化数据探索流程,帮助用户快速从海量数据中获取有价值的洞察,让复杂数据的分析与利用变得简单高效。
6579500M+ pulls
上次更新:未知
shinsenter/magento logo
shinsenter/magento
生产就绪的PHP/Magento Docker镜像,具备Magento Open Source自动安装功能,支持通过环境变量配置PHP和PHP-FPM,无需重建镜像即可调整设置,适用于快速部署Magento项目。
350K+ pulls
上次更新:未知
bitnami/elasticsearch logo
bitnami/elasticsearch
Bitnami为Elasticsearch提供的安全镜像,是预先配置且经过安全加固的解决方案,集成开源搜索引擎Elasticsearch的核心功能,可支持日志分析、全文搜索、实时数据处理等多种应用场景,通过优化性能、简化部署流程并遵循安全最佳实践,助力用户快速构建安全可靠的Elasticsearch运行环境,适用于开发、测试及生产环境,有效降低配置复杂度与潜在安全风险。
84100M+ pulls
上次更新:未知
bitnamicharts/elasticsearch logo
bitnamicharts/elasticsearch
Bitnami提供的Elasticsearch Helm chart,用于在Kubernetes环境中便捷部署和管理分布式搜索引擎Elasticsearch。
11M+ pulls
上次更新:未知
bitnami/elasticsearch-exporter logo
bitnami/elasticsearch-exporter
Bitnami安全镜像,用于运行elasticsearch-exporter,实现Elasticsearch集群指标的收集与导出,适用于监控系统集成。
710M+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
markoshust/magento-elasticsearch
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.