не удалось найти драйвер (SQL: выберите * из "..", где ".." = пользовательский лимит 1), не удалось создать приложение 'Services' при запуске docker -compose build в vscode cli - PullRequest
0 голосов
/ 12 марта 2020

Я получаю ошибку при создании приложения 403 Запрещено, как я могу решить эту проблему? Я уже ищу какое-то решение, но оно не работает. Может я ошибаюсь при настройке конфигурации?

Сообщение об ошибке

PS C:\Users\chris\Documents\logistic> docker-compose build
db uses an image, skipping
Building app
Step 1/4 : FROM php:7.1.19-fpm
 ---> f4041b9e5300
Step 2/4 : RUN apt-get update && apt-get install -y libpq-dev libmcrypt-dev && docker-php-ext-install pdo pgsql pdo_pgsql pdo_mysql --no-cache
 ---> Running in 829dd872ac3d
Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 Packages [520 kB]
Get:5 http://deb.debian.org/debian stretch Release [118 kB]
Get:6 http://deb.debian.org/debian stretch-updates/main amd64 Packages [27.9 kB]
Get:7 http://deb.debian.org/debian stretch Release.gpg [2410 B]
Get:8 http://deb.debian.org/debian stretch/main amd64 Packages [7083 kB]
Fetched 7937 kB in 7s (1084 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libmcrypt4 libpq5
Suggested packages:
  mcrypt postgresql-doc-9.6
The following NEW packages will be installed:
  libmcrypt-dev libmcrypt4 libpq-dev libpq5
0 upgraded, 4 newly installed, 0 to remove and 41 not upgraded.
Need to get 517 kB of archives.
After this operation, 2307 kB of additional disk space will be used.
Err:1 http://deb.debian.org/debian stretch/main amd64 libmcrypt4 amd64 2.5.8-3.3
  403  Forbidden
Err:2 http://deb.debian.org/debian stretch/main amd64 libmcrypt-dev amd64 2.5.8-3.3
  403  Forbidden
Err:4 http://security.debian.org/debian-security stretch/updates/main amd64 libpq-dev amd64 9.6.17-0+deb9u1
  403  Forbidden
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1 [137 kB]
Err:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.17-0+deb9u1
  403  Forbidden
E: Failed to fetch http://deb.debian.org/debian/pool/main/libm/libmcrypt/libmcrypt4_2.5.8-3.3_amd64.deb  403  Forbidden
E: Failed to fetch http://deb.debian.org/debian/pool/main/libm/libmcrypt/libmcrypt-dev_2.5.8-3.3_amd64.deb  403  Forbidden        
E: Failed to fetch http://security-cdn.debian.org/debian-security/pool/updates/main/p/postgresql-9.6/libpq5_9.6.17-0+deb9u1_amd64.deb  403  Forbidden
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/p/postgresql-9.6/libpq-dev_9.6.17-0+deb9u1_amd64.deb  403  Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libpq-dev libmcrypt-dev && docker-php-ext-install pdo pgsql pdo_pgsql pdo_mysql --no-cache' returned a non-zero code: 100
  • ЭТО НЕКОТОРЫЙ МОЙ LARAVEL ФАЙЛ:

app.dockerfile

FROM php:7.1.19-fpm

RUN apt-get update && apt-get install -y libpq-dev libmcrypt-dev && docker-php-ext-install pdo pgsql pdo_pgsql pdo_mysql --no-cache

WORKDIR /var/www

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

База данных. php

<?php

use Illuminate\Support\Str;

return [
    'default' => env('DB_CONNECTION', 'pgsql'),
    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'url' => env('DATABASE_URL'),
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

        'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '54320'),
            'database' => env('DB_DATABASE', 'logistic'),
            'username' => env('DB_USERNAME', 'postgres'),
            'password' => env('DB_PASSWORD', 'postgres'),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],

    ],

    'migrations' => 'migrations',

    'redis' => [

        'client' => env('REDIS_CLIENT', 'predis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'predis'),
            'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_',
        ],

        'default' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_DB', 0),
        ],

        'cache' => [
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', 6379),
            'database' => env('REDIS_CACHE_DB', 1),
        ],

    ],

];

docker -compose.yml

version: '3'
services:
  web:
    container_name: ${PROJECT_NAME}-web
    build:
      context: ./
      dockerfile: web.dockerfile
    volumes:
      - ./:/var/www
    ports:
      - "8080:80"
    links:
      - app

  app:
    container_name: ${PROJECT_NAME}-app
    build:
      context: ./
      dockerfile: app.dockerfile
    volumes:
      - ./:/var/www
    links:
      - db
    environment:
      - "DB_PORT=54320"
      - "DB_HOST=db"

  db:
    container_name: ${PROJECT_NAME}-db
    image: postgres:11.6
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=logistic
    ports:
      - "54320:5432"

ПРИМЕЧАНИЕ: Я ИСПОЛЬЗУЮ LARAVEL 5.8, DOCKER, POSTGRESQL IN NAVICAT PREMIUM Вот ошибка в сети

1 Ответ

0 голосов
/ 16 марта 2020

После того, как я спросил кого-то, кто может помочь, возможно, это проблема с соединением, я изменил Wi-Fi Connection на Mobile Hotspot, и он работает, чтобы запустить docker -compose build && docker -compose up -d идеально.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...