shopware / development

MIT License
189 stars 170 forks source link

Errors Starting Docker Containers #156

Closed astorm closed 2 years ago

astorm commented 3 years ago

Description

When following the README.md instructions for setting up a development environment in this repository, the ./psh.phar docker:start command fails. (full output below)

This appears to be a problem with the mysql:8 image

% docker pull mysql:8    
8: Pulling from library/mysql
no matching manifest for linux/arm64/v8 in the manifest list entries

not being available for ARM (I'm on an M1 Mac)

Possible Solution

I'd naively suggest using mariadb in place of MySQL, but I'm unsure whether mysql:8 was just a defacto choice or if there's specific reasons/features that keep you'all there.

Additional context

% ./psh.phar docker:start                 

###################

SHOPWARE Developer Version

       _
      | |
   ___| |__   ___  _ ____      ____ _ _ __ ___
  / __| '_ \ / _ \| '_ \ \ /\ / / _` | '__/ _ \
  \__ \ | | | (_) | |_) \ V  V / (_| | | |  __/
  |___/_| |_|\___/| .__/ \_/\_/ \__,_|_|  \___|
                  | |
                  |_|

Using .psh.yaml.dist

Starting Execution of 'docker:start' ('/Users/astorm/Documents/github/shopware/development/dev-ops/docker/actions/start.sh')

(1/3) Starting
> dev-ops/docker/scripts/check_permissions.sh

(2/3) Starting
> if [ -n "" ]; then docker-sync start && echo "\n docker-sync is initially indexing files. It may take some minutes, until code changes take effect"; fi

(3/3) Starting
> docker-compose build --parallel && docker-compose up -d
    cypress uses an image, skipping
    mailhog uses an image, skipping
    adminer uses an image, skipping
    elasticsearch uses an image, skipping
    Flag '--parallel' is ignored when building with COMPOSE_DOCKER_CLI_BUILD=1
    Building app_mysql  ... 
    Building app_server ... 
    Building app_server
    Building app_mysql
    shopware/platform#1 [internal] load build definition from Dockerfile
    shopware/platform#1 sha256:15635170a964a655c5de3b0eefbbb920700770096528e1d93fb860ab730d4838
    shopware/platform#1 transferring dockerfile: 37B done
    shopware/platform#1 DONE 0.0s

    shopware/platform#2 [internal] load .dockerignore
    shopware/platform#2 sha256:d3ef1cf0ea86248a2d472d0d5012164c926f523ad87de02ac3a9ab1e8605b8a0
    shopware/platform#2 transferring context: 2B done
    shopware/platform#2 DONE 0.0s
    shopware/platform#1 [internal] load build definition from Dockerfile
    shopware/platform#1 sha256:7502b19016fa878ebe76751bc7c9c687106861c9b2580aa5655603b44ef86ef4
    shopware/platform#1 transferring dockerfile: 37B done
    shopware/platform#1 DONE 0.0s

    shopware/platform#2 [internal] load .dockerignore
    shopware/platform#2 sha256:0ae8a21a49815911778ab0bc0aa19cc1c78527178dd53b84ad328fb69fdcd6c8
    shopware/platform#2 transferring context: 2B done
    shopware/platform#2 DONE 0.0s

    shopware/platform#3 [internal] load metadata for docker.io/webdevops/php-apache:7.4
    shopware/platform#3 sha256:71f6c26196ec6666c6e23f2932ae2bc36c4463ac3a2bc0215e93901d2535ea33

    shopware/platform#3 [internal] load metadata for docker.io/library/mysql:8
    shopware/platform#3 sha256:c260d31a8d501c278fc621dcf67c4a487f8b8e68105f365b876515354f23c11e
    shopware/platform#3 ERROR: no match for platform in manifest sha256:d50098d7fcb25b1fcb24e2d3247cae3fc55815d64fec640dc395840f8fa80969: not found
    ------
     > [internal] load metadata for docker.io/library/mysql:8:
    ------
    failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:d50098d7fcb25b1fcb24e2d3247cae3fc55815d64fec640dc395840f8fa80969: not found
    shopware/platform#3 DONE 1.3s

    shopware/platform#4 [1/7] FROM docker.io/webdevops/php-apache:7.4@sha256:81f3b043c44607c3a97746c5450118b6a7813eb61be550d8ea1e6ff24daecd07
    shopware/platform#4 sha256:decdc6f60e3c00a333f7bbf40f3fa883ff19e90272a74530b0a19954dee29ff1
    shopware/platform#4 DONE 0.0s

    shopware/platform#5 [internal] load build context
    shopware/platform#5 sha256:8558432bf44c48049980ea29577d28756650643053a45057f7af03a34a1e7264
    shopware/platform#5 transferring context: 70B done
    shopware/platform#5 DONE 0.0s

    shopware/platform#7 [3/7] RUN groupadd -r -g 20 appuser || true
    shopware/platform#7 sha256:a9a91ea926705dfb5bade6cb3a03a29d01b67b502b3125ef126eb0a35a8e77bc
    shopware/platform#7 CACHED

    shopware/platform#10 [6/7] COPY php-config.ini /usr/local/etc/php/conf.d/99-docker.ini
    shopware/platform#10 sha256:cd69155f6ef8dddde417ba3a2db69ae8076cac780213396097c9ae8e3b527c6f
    shopware/platform#10 CACHED

    shopware/platform#6 [2/7] COPY wait-for-it.sh /usr/local/bin/
    shopware/platform#6 sha256:c89a3508e2cfe32ccce8b067a1150089db8d09afae477515c2d8f41889b742d3
    shopware/platform#6 CACHED

    shopware/platform#8 [4/7] RUN useradd -r -u 501 -g 20 appuser || true
    shopware/platform#8 sha256:7a23efe07c5ac80bebd35c24efd7f314a6dbfd2ed220c6a5d6def277e01f3e32
    shopware/platform#8 CACHED

    shopware/platform#9 [5/7] RUN sed -ri -e 's!VirtualHost \*:80!VirtualHost \*:8000!g' /opt/docker/etc/httpd/vhost.conf     && echo "Listen 8000" | tee -a /etc/apache2/ports.conf         && curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -     && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'         && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -     && sh -c 'echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker.list'         && mkdir -p /usr/share/man/man1     && curl -sL https://deb.nodesource.com/setup_12.x | bash         && mkdir -p /.npm     && apt-install default-mysql-client nodejs google-chrome-stable libicu-dev graphviz vim gnupg2 docker-ce=5:18.09.7~3-0~debian-stretch libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb         && npm install -g npm@^6.14.11     && npm i forever -g     && chown -R 501:20 /.npm         && ln -s /app/psh.phar /bin/psh         && pecl install pcov     && docker-php-ext-enable pcov
    shopware/platform#9 sha256:b55f57b98a86166ba4020d5ed6badcc869e472f43a96ee37c45fd25b0d53b93e
    shopware/platform#9 CACHED

    shopware/platform#11 [7/7] WORKDIR /app
    shopware/platform#11 sha256:b5fca0abd57b6aad0602266530bb948cffc45c53f22cb9af59af77cfed94dcf9
    shopware/platform#11 CACHED

    shopware/platform#12 exporting to image
    shopware/platform#12 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
    shopware/platform#12 exporting layers done
    shopware/platform#12 writing image sha256:5f58d934aeeb2f1773efaf4008ed5da186fe5cf74f57378d84e6eb1763ed0398 done
    shopware/platform#12 naming to docker.io/shopware/development:local done
    shopware/platform#12 DONE 0.0s

    Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
    Building app_server ... done

    ERROR: for app_mysql  (<Service: app_mysql>, 'Build failed')
    Service 'app_mysql' failed to build : Build failed

Execution aborted, a subcommand failed!
PremKishan98 commented 3 years ago

Hi, Try using docker pull mysql instead of docker pull mysql:8. This might help you to run the command without any interruptions

holyspecter commented 2 years ago

For mysql service adding platform: linux/amd64 to docker-compose.yml worked for me.

Although I have another issue with app container:

app_server_1     | runtime: failed to create new OS thread (have 2 already; errno=22)
app_server_1     | fatal error: newosproc

Did someone find a way to fix it?

iulianbeleiu commented 2 years ago

For mysql service adding platform: linux/amd64 to docker-compose.yml worked for me.

Although I have another issue with app container:

app_server_1     | runtime: failed to create new OS thread (have 2 already; errno=22)
app_server_1     | fatal error: newosproc

Did someone find a way to fix it?

I have the same issue