Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Magento Docker Setup for Macbook having M1 Chip

NotificationsYou must be signed in to change notification settings

mappiecoder/magento-docker-setup-mac-os-m1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Fork designed to work on the Mac com Apple Silicon Chip(M1)

To see the official README, go to the main project

This README will show you how to install a new project or use existing projects on macs with M1

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 with M1.

Setup

Manual Setup

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

New Projects

# Download the Docker Compose template:curl -s https://raw.githubusercontent.com/luancschmitz/docker-magento/master/lib/template| bash# Build the imagesdocker-compose build# 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=https://repo.magento.com/ --ignore-platform-reqs --prefer-dist magento/project-community-edition=2.4.1 src## COMMERCE:## rm -rf src# composer create-project --repository=https://repo.magento.com/ --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.testopen https://magento2.test

Existing Projects

# Download the Docker Compose template:curl -s https://raw.githubusercontent.com/luancschmitz/docker-magento/master/lib/template| bash#Build the Imagesdocker-compose build# Replace with existing source code of your existing Magento instance:cp -R~/Sites/existing src# or: git clone git@github.com: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 -drm -rf src/vendorbin/copytocontainer --all## Initial copy will take a few minutes...# Install composer dependencies, then copy artifacts back to the host (for debugging purposes):bin/composer installbin/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 https://yoursite.test/bin/magento config:set web/unsecure/base_url https://yoursite.test/bin/restartopen https://magento2.test

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

Custom CLI Commands

  • bin/bash: Drop into the bash prompt of your Docker container. Thephpfpm container should be mainly used to access the filesystem within Docker.
  • bin/cache-clean: Access thecache-clean CLI. Note the watcher is automatically started at startup inbin/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 asbin/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 forbin/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 thesrc 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 fromenv/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 then98-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. Exbin/root apt-get install nano
  • bin/rootnotty: Run any CLI command as root with no TTY. Exbin/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 tomagento2.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 defaultmaster-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 ofdocker-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 ofdocker-magento.
  • bin/xdebug: Disable or enable Xdebug. Accepts paramsdisable (default) orenable. Ex.bin/xdebug enable

Credits

M.academy

About

Magento Docker Setup for Macbook having M1 Chip

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell82.4%
  • Dockerfile17.6%

[8]ページ先頭

©2009-2025 Movatter.jp