英文:
crypto/ecdh: package crypto/ecdh is not in GOROOT (/usr/local/go/src/crypto/ecdh) in dunglas/symfony-docker
问题
My dockerfile :
#syntax=docker/dockerfile:1.4
# The different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# https://docs.docker.com/compose/compose-file/#target
# Builder images
FROM composer/composer:2-bin AS composer
FROM mlocati/php-extension-installer:latest AS php_extension_installer
# Build Caddy with the Mercure and Vulcain modules
FROM caddy:2.6-builder-alpine AS app_caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
# Prod image
FROM php:8.2-fpm-alpine AS app_php
# Allow to use development versions of Symfony
ARG STABILITY="stable"
ENV STABILITY ${STABILITY}
# Allow to select Symfony version
ARG SYMFONY_VERSION=""
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
ENV APP_ENV=prod
WORKDIR /srv/app
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=php_extension_installer --link /usr/bin/install-php-extensions /usr/local/bin/
# persistent / runtime deps
RUN apk add --no-cache \
acl \
openssh \
fcgi \
file \
bash \
gettext \
git \
libxslt-dev \
;
RUN set -eux; \
install-php-extensions \
intl \
zip \
apcu \
opcache \
;
###> recipes ###
###> doctrine/doctrine-bundle ###
RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \
docker-php-ext-install -j"$(nproc)" pdo_pgsql; \
apk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \
apk del .pgsql-deps
###< doctrine/doctrine-bundle ###
###< recipes ###
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf
RUN mkdir -p /var/run/php
#COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
#RUN chmod +x /usr/local/bin/docker-healthcheck
#HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY --from=composer --link /composer /usr/bin/composer
# Make ssh dir
RUN mkdir /root/.ssh/
RUN chmod 0700 /root/.ssh
# Copy over private key, and set permissions
# Warning! Anyone who gets their hands on this image will be able
# to retrieve this private key file from the corresponding image layer
COPY ./docker/ssh/id_rsa /root/.ssh/id_rsa
COPY ./docker/ssh/id_rsa.pub /root/.ssh/id_rsa.pub
COPY ./docker/ssh/known_hosts /root/.ssh/known_hosts
RUN chmod 400 /root/.ssh/id_rsa.pub && chgrp 545 /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa
RUN ls -la /root/.ssh
RUN more /root/.ssh/id_rsa.pub
# prevent the reinstallation of vendors at every changes in the source code
COPY --link composer.* symfony.* ./
RUN set -eux; \
if [ -f composer.json ]; then \
composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \
composer clear-cache; \
fi
# copy sources
COPY --link . ./
RUN rm -Rf docker/
RUN set -eux; \
mkdir -p var/cache var/log; \
if [ -f composer.json ]; then \
composer dump-autoload --classmap-authoritative --no-dev; \
composer dump-env prod; \
composer run
<details>
<summary>英文:</summary>
My dockerfile :
#syntax=docker/dockerfile:1.4
# The different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# https://docs.docker.com/compose/compose-file/#target
# Builder images
FROM composer/composer:2-bin AS composer
FROM mlocati/php-extension-installer:latest AS php_extension_installer
# Build Caddy with the Mercure and Vulcain modules
FROM caddy:2.6-builder-alpine AS app_caddy_builder
RUN xcaddy build \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
# Prod image
FROM php:8.2-fpm-alpine AS app_php
# Allow to use development versions of Symfony
ARG STABILITY="stable"
ENV STABILITY ${STABILITY}
# Allow to select Symfony version
ARG SYMFONY_VERSION=""
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
ENV APP_ENV=prod
WORKDIR /srv/app
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
COPY --from=php_extension_installer --link /usr/bin/install-php-extensions /usr/local/bin/
# persistent / runtime deps
RUN apk add --no-cache \
acl \
openssh \
fcgi \
file \
bash \
gettext \
git \
libxslt-dev \
;
RUN set -eux; \
install-php-extensions \
intl \
zip \
apcu \
opcache \
;
###> recipes ###
###> doctrine/doctrine-bundle ###
RUN apk add --no-cache --virtual .pgsql-deps postgresql-dev; \
docker-php-ext-install -j"$(nproc)" pdo_pgsql; \
apk add --no-cache --virtual .pgsql-rundeps so:libpq.so.5; \
apk del .pgsql-deps
###< doctrine/doctrine-bundle ###
###< recipes ###
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY --link docker/php/php-fpm.d/zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf
RUN mkdir -p /var/run/php
#COPY --link docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
#RUN chmod +x /usr/local/bin/docker-healthcheck
#HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
COPY --link docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY --from=composer --link /composer /usr/bin/composer
# Make ssh dir
RUN mkdir /root/.ssh/
RUN chmod 0700 /root/.ssh
# Copy over private key, and set permissions
# Warning! Anyone who gets their hands on this image will be able
# to retrieve this private key file from the corresponding image layer
COPY ./docker/ssh/id_rsa /root/.ssh/id_rsa
COPY ./docker/ssh/id_rsa.pub /root/.ssh/id_rsa.pub
COPY ./docker/ssh/known_hosts /root/.ssh/known_hosts
RUN chmod 400 /root/.ssh/id_rsa.pub && chgrp 545 /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa
RUN ls -la /root/.ssh
RUN more /root/.ssh/id_rsa.pub
# prevent the reinstallation of vendors at every changes in the source code
COPY --link composer.* symfony.* ./
RUN set -eux; \
if [ -f composer.json ]; then \
composer install --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress; \
composer clear-cache; \
fi
# copy sources
COPY --link . ./
RUN rm -Rf docker/
RUN set -eux; \
mkdir -p var/cache var/log; \
if [ -f composer.json ]; then \
composer dump-autoload --classmap-authoritative --no-dev; \
composer dump-env prod; \
composer run-script --no-dev post-install-cmd; \
chmod +x bin/console; sync; \
fi
# Dev image
FROM app_php AS app_php_dev
ENV APP_ENV=dev XDEBUG_MODE=off
VOLUME /srv/app/var/
RUN rm "$PHP_INI_DIR/conf.d/app.prod.ini"; \
mv "$PHP_INI_DIR/php.ini" "$PHP_INI_DIR/php.ini-production"; \
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
COPY --link docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
RUN set -eux; \
install-php-extensions xdebug
RUN rm -f .env.local.php
# Caddy image
FROM caddy:2.6-alpine AS app_caddy
WORKDIR /srv/app
COPY --from=app_caddy_builder --link /usr/bin/caddy /usr/bin/caddy
COPY --from=app_php --link /srv/app/public public/
COPY --link docker/caddy/Caddyfile /etc/caddy/Caddyfile
Error:
=> CACHED [app_php 27/27] RUN set -eux; mkdir -p var/cache var/log; if [ -f composer.json ]; then composer dump-autoload --classmap-authoritative --no-dev; composer dump-env prod; composer run-script --no-dev 0.0s
=> ERROR [app_caddy_builder 2/2] RUN xcaddy build --with github.com/dunglas/mercure --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain --with github.com/dunglas/vulcain/caddy 39.8s
------
> [app_caddy_builder 2/2] RUN xcaddy build --with github.com/dunglas/mercure --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain --with github.com/dunglas/vulcain/caddy:
#0 0.252 2023/06/12 08:52:17 [INFO] Temporary folder: /tmp/buildenv_2023-06-12-0852.2270659827
#0 0.252 2023/06/12 08:52:17 [INFO] Writing main module: /tmp/buildenv_2023-06-12-0852.2270659827/main.go
#0 0.252 package main
#0 0.252
#0 0.252 import (
#0 0.252 caddycmd "github.com/caddyserver/caddy/v2/cmd"
#0 0.252
#0 0.252 // plug in Caddy modules here
#0 0.252 _ "github.com/caddyserver/caddy/v2/modules/standard"
#0 0.252 _ "github.com/dunglas/mercure"
#0 0.252 _ "github.com/dunglas/mercure/caddy"
#0 0.252 _ "github.com/dunglas/vulcain"
#0 0.252 _ "github.com/dunglas/vulcain/caddy"
#0 0.252 )
#0 0.252
#0 0.252 func main() {
#0 0.252 caddycmd.Main()
#0 0.252 }
#0 0.253 2023/06/12 08:52:17 [INFO] Initializing Go module
#0 0.253 2023/06/12 08:52:17 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go mod init caddy
#0 0.256 go: creating new go.mod: module caddy
#0 0.257 go: to add module requirements and sums:
#0 0.257 go mod tidy
#0 0.258 2023/06/12 08:52:17 [INFO] Pinning versions
#0 0.258 2023/06/12 08:52:17 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@v2.6.4
#0 0.363 go: downloading github.com/caddyserver/caddy/v2 v2.6.4
#0 0.993 go: downloading github.com/caddyserver/certmagic v0.17.2
#0 0.995 go: downloading github.com/google/uuid v1.3.0
#0 0.996 go: downloading github.com/prometheus/client_golang v1.14.0
#0 0.996 go: downloading github.com/quic-go/quic-go v0.32.0
#0 0.998 go: downloading go.uber.org/zap v1.24.0
#0 0.999 go: downloading golang.org/x/sys v0.5.0
#0 0.999 go: downloading golang.org/x/term v0.5.0
#0 1.155 go: downloading go.uber.org/atomic v1.9.0
#0 1.156 go: downloading go.uber.org/multierr v1.6.0
#0 1.158 go: downloading github.com/beorn7/perks v1.0.1
#0 1.158 go: downloading github.com/cespare/xxhash/v2 v2.1.2
#0 1.158 go: downloading github.com/golang/protobuf v1.5.2
#0 1.191 go: downloading github.com/cespare/xxhash v1.1.0
#0 1.202 go: downloading github.com/prometheus/client_model v0.3.0
#0 1.213 go: downloading github.com/prometheus/common v0.37.0
#0 1.241 go: downloading github.com/prometheus/procfs v0.8.0
#0 1.242 go: downloading google.golang.org/protobuf v1.28.1
#0 1.558 go: downloading github.com/klauspost/cpuid/v2 v2.2.3
#0 1.559 go: downloading github.com/libdns/libdns v0.2.1
#0 1.738 go: downloading github.com/mholt/acmez v1.1.0
#0 1.862 go: downloading github.com/miekg/dns v1.1.50
#0 1.862 go: downloading golang.org/x/crypto v0.5.0
#0 1.862 go: downloading golang.org/x/net v0.7.0
#0 1.863 go: downloading github.com/golang/mock v1.6.0
#0 1.863 go: downloading github.com/onsi/ginkgo/v2 v2.2.0
#0 1.863 go: downloading github.com/quic-go/qpack v0.4.0
#0 1.937 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
#0 1.970 go: downloading golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
#0 1.988 go: downloading github.com/quic-go/qtls-go1-18 v0.2.0
#0 2.168 go: downloading github.com/quic-go/qtls-go1-19 v0.2.0
#0 2.333 go: downloading github.com/quic-go/qtls-go1-20 v0.1.0
#0 2.356 go: downloading golang.org/x/tools v0.2.0
#0 2.366 go: downloading golang.org/x/mod v0.6.0
#0 2.373 go: downloading github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
#0 2.381 go: downloading github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
#0 2.432 go: downloading golang.org/x/text v0.7.0
#0 6.932 go: added github.com/beorn7/perks v1.0.1
#0 6.932 go: added github.com/caddyserver/caddy/v2 v2.6.4
#0 6.932 go: added github.com/caddyserver/certmagic v0.17.2
#0 6.932 go: added github.com/cespare/xxhash/v2 v2.1.2
#0 6.932 go: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
#0 6.932 go: added github.com/golang/mock v1.6.0
#0 6.932 go: added github.com/golang/protobuf v1.5.2
#0 6.932 go: added github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
#0 6.932 go: added github.com/google/uuid v1.3.0
#0 6.932 go: added github.com/klauspost/cpuid/v2 v2.2.3
#0 6.932 go: added github.com/libdns/libdns v0.2.1
#0 6.932 go: added github.com/matttproud/golang_protobuf_extensions v1.0.1
#0 6.932 go: added github.com/mholt/acmez v1.1.0
#0 6.932 go: added github.com/miekg/dns v1.1.50
#0 6.932 go: added github.com/onsi/ginkgo/v2 v2.2.0
#0 6.932 go: added github.com/prometheus/client_golang v1.14.0
#0 6.932 go: added github.com/prometheus/client_model v0.3.0
#0 6.932 go: added github.com/prometheus/common v0.37.0
#0 6.932 go: added github.com/prometheus/procfs v0.8.0
#0 6.932 go: added github.com/quic-go/qpack v0.4.0
#0 6.932 go: added github.com/quic-go/qtls-go1-18 v0.2.0
#0 6.932 go: added github.com/quic-go/qtls-go1-19 v0.2.0
#0 6.932 go: added github.com/quic-go/qtls-go1-20 v0.1.0
#0 6.932 go: added github.com/quic-go/quic-go v0.32.0
#0 6.932 go: added go.uber.org/atomic v1.9.0
#0 6.932 go: added go.uber.org/multierr v1.6.0
#0 6.932 go: added go.uber.org/zap v1.24.0
#0 6.932 go: added golang.org/x/crypto v0.5.0
#0 6.932 go: added golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
#0 6.932 go: added golang.org/x/mod v0.6.0
#0 6.932 go: added golang.org/x/net v0.7.0
#0 6.932 go: added golang.org/x/sys v0.5.0
#0 6.932 go: added golang.org/x/term v0.5.0
#0 6.932 go: added golang.org/x/text v0.7.0
#0 6.932 go: added golang.org/x/tools v0.2.0
#0 6.932 go: added google.golang.org/protobuf v1.28.1
#0 6.940 2023/06/12 08:52:23 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/dunglas/mercure github.com/caddyserver/caddy/v2@v2.6.4
#0 7.519 go: downloading github.com/dunglas/mercure v0.14.10
#0 8.191 go: downloading github.com/prometheus/client_golang v1.15.1
#0 8.192 go: downloading golang.org/x/sys v0.8.0
#0 8.192 go: downloading golang.org/x/term v0.8.0
#0 8.192 go: downloading github.com/dgraph-io/ristretto v0.1.1
#0 8.193 go: downloading github.com/gofrs/uuid v4.4.0+incompatible
#0 8.193 go: downloading github.com/golang-jwt/jwt/v4 v4.5.0
#0 8.193 go: downloading github.com/gorilla/handlers v1.5.1
#0 8.194 go: downloading github.com/gorilla/mux v1.8.0
#0 8.195 go: downloading github.com/hashicorp/golang-lru v0.5.4
#0 8.263 go: downloading github.com/kevburnsjr/skipfilter v0.0.1
#0 8.267 go: downloading github.com/spf13/pflag v1.0.5
#0 8.276 go: downloading github.com/spf13/viper v1.15.0
#0 8.286 go: downloading github.com/unrolled/secure v1.13.0
#0 8.286 go: downloading github.com/yosida95/uritemplate/v3 v3.0.2
#0 8.286 go: downloading go.etcd.io/bbolt v1.3.7
#0 8.292 go: downloading golang.org/x/crypto v0.9.0
#0 8.329 go: downloading golang.org/x/net v0.10.0
#0 8.361 go: downloading go.uber.org/atomic v1.11.0
#0 8.388 go: downloading go.uber.org/multierr v1.11.0
#0 8.525 go: downloading github.com/felixge/httpsnoop v1.0.3
#0 8.526 go: downloading github.com/cespare/xxhash/v2 v2.2.0
#0 8.540 go: downloading github.com/prometheus/client_model v0.4.0
#0 8.553 go: downloading github.com/prometheus/common v0.44.0
#0 8.572 go: downloading github.com/prometheus/procfs v0.10.0
#0 8.600 go: downloading google.golang.org/protobuf v1.30.0
#0 8.610 go: downloading golang.org/x/tools v0.6.0
#0 8.612 go: downloading golang.org/x/mod v0.8.0
#0 8.613 go: downloading github.com/MauriceGit/skiplist v0.0.0-20211105230623-77f5c8d3e145
#0 8.621 go: downloading github.com/RoaringBitmap/roaring v1.3.0
#0 8.622 go: downloading github.com/fsnotify/fsnotify v1.6.0
#0 8.622 go: downloading github.com/mitchellh/mapstructure v1.5.0
#0 8.654 go: downloading github.com/spf13/afero v1.9.5
#0 8.663 go: downloading github.com/spf13/cast v1.5.1
#0 8.702 go: downloading github.com/spf13/jwalterweatherman v1.1.0
#0 8.720 go: downloading github.com/dustin/go-humanize v1.0.1
#0 8.734 go: downloading github.com/golang/glog v1.1.1
#0 8.738 go: downloading github.com/pkg/errors v0.9.1
#0 8.754 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
#0 8.783 go: downloading golang.org/x/text v0.9.0
#0 8.946 go: downloading github.com/subosito/gotenv v1.4.2
#0 8.946 go: downloading github.com/hashicorp/hcl v1.0.0
#0 8.946 go: downloading gopkg.in/ini.v1 v1.67.0
#0 8.946 go: downloading github.com/magiconair/properties v1.8.7
#0 8.993 go: downloading github.com/pelletier/go-toml/v2 v2.0.8
#0 8.994 go: downloading gopkg.in/yaml.v3 v3.0.1
#0 9.019 go: downloading github.com/golang/protobuf v1.5.3
#0 18.75 go: downloading github.com/mschoch/smat v0.2.0
#0 18.75 go: downloading github.com/bits-and-blooms/bitset v1.7.0
#0 20.58 go: added github.com/MauriceGit/skiplist v0.0.0-20211105230623-77f5c8d3e145
#0 20.58 go: added github.com/RoaringBitmap/roaring v1.3.0
#0 20.58 go: added github.com/bits-and-blooms/bitset v1.7.0
#0 20.58 go: upgraded github.com/cespare/xxhash/v2 v2.1.2 => v2.2.0
#0 20.58 go: upgraded github.com/dgraph-io/ristretto v0.1.0 => v0.1.1
#0 20.58 go: added github.com/dunglas/mercure v0.14.10
#0 20.58 go: added github.com/fsnotify/fsnotify v1.6.0
#0 20.58 go: added github.com/gofrs/uuid v4.4.0+incompatible
#0 20.58 go: added github.com/golang-jwt/jwt/v4 v4.5.0
#0 20.58 go: upgraded github.com/golang/glog v1.0.0 => v1.1.1
#0 20.58 go: upgraded github.com/golang/protobuf v1.5.2 => v1.5.3
#0 20.58 go: added github.com/gorilla/handlers v1.5.1
#0 20.58 go: added github.com/gorilla/mux v1.8.0
#0 20.58 go: upgraded github.com/hashicorp/golang-lru v0.5.1 => v0.5.4
#0 20.58 go: added github.com/hashicorp/hcl v1.0.0
#0 20.58 go: added github.com/kevburnsjr/skipfilter v0.0.1
#0 20.58 go: added github.com/magiconair/properties v1.8.7
#0 20.58 go: upgraded github.com/matttproud/golang_protobuf_extensions v1.0.1 => v1.0.4
#0 20.58 go: added github.com/mitchellh/mapstructure v1.5.0
#0 20.58 go: added github.com/mschoch/smat v0.2.0
#0 20.58 go: added github.com/pelletier/go-toml/v2 v2.0.8
#0 20.58 go: upgraded github.com/prometheus/client_golang v1.14.0 => v1.15.1
#0 20.58 go: upgraded github.com/prometheus/client_model v0.3.0 => v0.4.0
#0 20.58 go: upgraded github.com/prometheus/common v0.37.0 => v0.44.0
#0 20.58 go: upgraded github.com/prometheus/procfs v0.8.0 => v0.10.0
#0 20.58 go: added github.com/spf13/afero v1.9.5
#0 20.58 go: upgraded github.com/spf13/cast v1.4.1 => v1.5.1
#0 20.58 go: added github.com/spf13/jwalterweatherman v1.1.0
#0 20.58 go: added github.com/spf13/viper v1.15.0
#0 20.58 go: added github.com/subosito/gotenv v1.4.2
#0 20.58 go: added github.com/unrolled/secure v1.13.0
#0 20.58 go: added github.com/yosida95/uritemplate/v3 v3.0.2
#0 20.58 go: upgraded go.etcd.io/bbolt v1.3.6 => v1.3.7
#0 20.58 go: upgraded go.uber.org/atomic v1.9.0 => v1.11.0
#0 20.58 go: upgraded go.uber.org/multierr v1.6.0 => v1.11.0
#0 20.58 go: upgraded golang.org/x/crypto v0.5.0 => v0.9.0
#0 20.58 go: upgraded golang.org/x/mod v0.6.0 => v0.8.0
#0 20.58 go: upgraded golang.org/x/net v0.7.0 => v0.10.0
#0 20.58 go: upgraded golang.org/x/sys v0.5.0 => v0.8.0
#0 20.58 go: upgraded golang.org/x/term v0.5.0 => v0.8.0
#0 20.58 go: upgraded golang.org/x/text v0.7.0 => v0.9.0
#0 20.58 go: upgraded golang.org/x/tools v0.2.0 => v0.6.0
#0 20.58 go: upgraded google.golang.org/protobuf v1.28.1 => v1.30.0
#0 20.58 go: added gopkg.in/ini.v1 v1.67.0
#0 20.58 2023/06/12 08:52:37 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/dunglas/mercure/caddy github.com/caddyserver/caddy/v2@v2.6.4
#0 21.09 go: downloading github.com/dunglas/mercure/caddy v0.14.10
#0 22.39 go: downloading github.com/quic-go/quic-go v0.34.0
#0 22.39 go: downloading github.com/klauspost/cpuid/v2 v2.2.4
#0 22.39 go: downloading github.com/mholt/acmez v1.1.1
#0 22.42 go: downloading github.com/miekg/dns v1.1.54
#0 22.43 go: downloading github.com/google/cel-go v0.15.3
#0 22.56 go: downloading google.golang.org/genproto v0.0.0-20230524185152-1884fd1fac28
#0 22.58 go: downloading github.com/smallstep/certificates v0.24.2
#0 22.73 go: downloading github.com/smallstep/truststore v0.12.1
#0 22.73 go: downloading go.step.sm/crypto v0.30.0
#0 22.74 go: downloading github.com/tailscale/tscert v0.0.0-20230509043813-4e9cb4f2b4ad
#0 22.74 go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b
#0 22.74 go: downloading github.com/spf13/cobra v1.7.0
#0 22.74 go: downloading golang.org/x/tools v0.9.1
#0 22.84 go: downloading github.com/onsi/ginkgo/v2 v2.9.5
#0 22.84 go: downloading github.com/stoewer/go-strcase v1.3.0
#0 22.99 go: downloading github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df
#0 22.99 go: downloading github.com/inconshreveable/mousetrap v1.1.0
#0 22.99 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
#0 23.02 go: downloading github.com/quic-go/qtls-go1-19 v0.3.2
#0 23.03 go: downloading github.com/quic-go/qtls-go1-20 v0.2.2
#0 23.03 go: downloading golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
#0 23.04 go: downloading golang.org/x/mod v0.10.0
#0 23.09 go: downloading github.com/smallstep/nosql v0.6.0
#0 23.11 go: downloading go.step.sm/cli-utils v0.7.6
#0 23.13 go: downloading go.step.sm/linkedca v0.19.1
#0 23.13 go: downloading google.golang.org/grpc v1.55.0
#0 23.29 go: downloading gopkg.in/square/go-jose.v2 v2.6.0
#0 23.30 go: downloading github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
#0 23.39 go: downloading github.com/slackhq/nebula v1.7.1
#0 23.39 go: downloading howett.net/plist v1.0.0
#0 23.41 go: downloading github.com/russross/blackfriday/v2 v2.1.0
#0 23.42 go: downloading github.com/micromdm/scep/v2 v2.1.0
#0 23.43 go: downloading github.com/Masterminds/sprig/v3 v3.2.3
#0 23.43 go: downloading go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352
#0 23.49 go: downloading filippo.io/edwards25519 v1.0.0
#0 23.49 go: downloading github.com/Microsoft/go-winio v0.6.1
#0 23.54 go: downloading github.com/mitchellh/go-ps v1.0.0
#0 23.57 go: downloading github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
#0 23.57 go: downloading github.com/urfave/cli v1.22.13
#0 23.57 go: downloading github.com/chzyer/readline v1.5.1
#0 23.57 go: downloading github.com/manifoldco/promptui v0.9.0
#0 23.59 go: downloading github.com/go-kit/kit v0.12.0
#0 23.63 go: downloading github.com/dgraph-io/badger v1.6.2
#0 23.63 go: downloading github.com/dgraph-io/badger/v2 v2.2007.4
#0 23.65 go: downloading github.com/go-sql-driver/mysql v1.7.1
#0 23.65 go: downloading github.com/jackc/pgx/v4 v4.18.1
#0 23.73 go: downloading github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3
#0 23.73 go: downloading github.com/Masterminds/goutils v1.1.1
#0 23.73 go: downloading github.com/Masterminds/semver/v3 v3.2.1
#0 23.73 go: downloading github.com/imdario/mergo v0.3.15
#0 23.73 go: downloading github.com/mitchellh/copystructure v1.2.0
#0 23.73 go: downloading github.com/huandu/xstrings v1.4.0
#0 23.73 go: downloading github.com/shopspring/decimal v1.3.1
#0 23.74 go: downloading github.com/go-kit/log v0.2.1
#0 23.75 go: downloading github.com/jackc/pgconn v1.14.0
#0 23.80 go: downloading github.com/jackc/pgtype v1.14.0
#0 23.82 go: downloading github.com/jackc/pgio v1.0.0
#0 23.82 go: downloading github.com/jackc/pgproto3/v2 v2.3.2
#0 23.82 go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
#0 23.82 go: downloading github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13
#0 23.86 go: downloading github.com/mitchellh/reflectwalk v1.0.2
#0 23.86 go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
#0 23.87 go: downloading github.com/go-logfmt/logfmt v0.6.0
#0 23.87 go: downloading github.com/jackc/chunkreader/v2 v2.0.1
#0 23.88 go: downloading github.com/jackc/pgpassfile v1.0.0
#0 23.88 go: downloading github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
#0 23.89 go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
#0 23.90 go: downloading github.com/golang/snappy v0.0.4
#0 23.91 go: downloading github.com/klauspost/compress v1.16.5
#0 23.91 go: downloading github.com/mattn/go-colorable v0.1.13
#0 23.95 go: downloading github.com/mattn/go-isatty v0.0.19
#0 39.12 github.com/dunglas/mercure/caddy imports
#0 39.12 github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile imports
#0 39.12 github.com/caddyserver/caddy/v2/modules/caddytls imports
#0 39.12 github.com/smallstep/certificates/authority/provisioner imports
#0 39.12 github.com/slackhq/nebula/cert imports
#0 39.12 crypto/ecdh: package crypto/ecdh is not in GOROOT (/usr/local/go/src/crypto/ecdh)
#0 39.65 2023/06/12 08:52:56 [FATAL] exit status 1
------
Dockerfile:15
--------------------
14 |
15 | >>> RUN xcaddy build \
16 | >>> --with github.com/dunglas/mercure \
17 | >>> --with github.com/dunglas/mercure/caddy \
18 | >>> --with github.com/dunglas/vulcain \
19 | >>> --with github.com/dunglas/vulcain/caddy
20 |
--------------------
ERROR: failed to solve: process "/bin/sh -c xcaddy build \t--with github.com/dunglas/mercure \t--with github.com/dunglas/mercure/caddy \t--with github.com/dunglas/vulcain \t--with github.com/dunglas/vulcain/caddy" did not complete successfully: exit code: 1
What I missing ?
(I think few months ago is build successfully)
UPDATE
i use this code
# Build Caddy with the Mercure and Vulcain modules
# Temporary fix for https://github.com/dunglas/mercure/issues/770
FROM caddy:2.7-builder-alpine AS app_caddy_builder
RUN xcaddy build v2.6.4 \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
work some time but now have
23.40 go: downloading github.com/dunglas/mercure/caddy v0.15.2
23.67 go: github.com/dunglas/mercure/caddy@upgrade (v0.15.2) requires github.com/caddyserver/caddy/v2@v2.7.2, not github.com/caddyserver/caddy/v2@v2.6.4
23.67 2023/08/08 08:18:52 [FATAL] exit status 1
------
Dockerfile:16
--------------------
15 |
16 | >>> RUN xcaddy build v2.6.4 \
17 | >>> --with github.com/dunglas/mercure \
18 | >>> --with github.com/dunglas/mercure/caddy \
19 | >>> --with github.com/dunglas/vulcain \
20 | >>> --with github.com/dunglas/vulcain/caddy
21 |
--------------------
ERROR: failed to solve: process "/bin/sh -c xcaddy build v2.6.4 \t--with github.com/dunglas/mercure \t--with github.com/dunglas/mercure/caddy \t--with github.com/dunglas/vulcain \t--with github.com/dunglas/vulcain/caddy" did not complete successfully: exit code: 1
ERROR: Service 'caddy' failed to build : Build failed
UPDATE 2
i change to
# Build Caddy with the Mercure and Vulcain modules
# Temporary fix for https://github.com/dunglas/mercure/issues/770
FROM caddy:2.7-builder-alpine AS app_caddy_builder
RUN xcaddy build v2.7.2 \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain \
--with github.com/dunglas/vulcain/caddy
but get
database_1 | 2023-06-06 10:37:29.170 UTC [5711] DETAIL: Role "postgres" does not exist.
database_1 | Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
Before try build app works fine - I dont change anythink
How to fix this ?
</details>
# 答案1
**得分**: 1
"如Alex Marina在他的回复中所说:在Dockerfile中,选择Caddy 2.7版本来构建可以修复错误。
问题出在golang已从版本1.19升级到版本1.20。
Caddy在稳定版本(2.6.4)中使用的是版本1.19。
Mercure和Vulcain扩展已升级到1.20,无法与1.19编译。
Caddy将在其下一个版本7中使用golang 1.20(目前是beta版本)。
因此,一个临时解决方案是保持caddy镜像2.6.4(当前稳定版本)用于caddy服务器,并使用镜像2.7(beta版)来构建扩展。
就像在这个补丁中:https://github.com/api-platform/api-platform/pull/2453/files"
<details>
<summary>英文:</summary>
As Alex Marina said in his reply : In the Dockerfile, choosing the Caddy 2.7 version for the build corrects the error.
What's happened is that golang has been upgraded from version 1.19 to version 1.20.
Caddy in stable version (2.6.4) uses version 1.19.
Mercure and Vulcain extensions have been upgraded to 1.20 and do not compile with 1.19.
Caddy will use golang 1.20 in its next version 7 (currently in beta).
So a temporary solution is to keep caddy image 2.6.4(current stable) for caddy server and use image 2.7(beta) for the extensions build.
As in this patch: https://github.com/api-platform/api-platform/pull/2453/files
</details>
# 答案2
**得分**: 0
如果没有连接到docker,如果任何人在不同情境下遇到警告,更新golang到1.20版本会有所帮助。
<details>
<summary>英文:</summary>
Without connection to docker, if anyone encounters warning in a different context, updating golang to version 1.20 helped
</details>
# 答案3
**得分**: 0
Here's the translated content:
现在的情况回来
FROM caddy:2.7-builder-alpine AS app_caddy_builder
运行 xcaddy 构建 v2.7.2 \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy
# --with github.com/dunglas/vulcain \
# --with github.com/dunglas/vulcain/caddy
获取
Dockerfile:18
--------------------
17 |
18 | >>> 运行 xcaddy 构建 v2.7.2 \
19 | >>> --with github.com/dunglas/mercure \
20 | >>> --with github.com/dunglas/mercure/caddy
21 | # --with github.com/dunglas/vulcain \
--------------------
错误: 无法解决 - 进程 "/bin/sh -c xcaddy 构建 v2.7.2 \t--with github.com/dunglas/mercure \t--with github.com/dunglas/mercure/caddy" 未成功完成: 退出代码: 1
错误: 服务 'caddy' 构建失败
这个是否已准备好用于生产?
错误会自行返回,每隔一段时间。
I've translated the code portions while keeping the code intact and the rest of the text as-is. If you need further assistance, feel free to ask.
<details>
<summary>英文:</summary>
now sitation back :)
FROM caddy:2.7-builder-alpine AS app_caddy_builder
RUN xcaddy build v2.7.2 \
--with github.com/dunglas/mercure \
--with github.com/dunglas/mercure/caddy
# --with github.com/dunglas/vulcain \
# --with github.com/dunglas/vulcain/caddy
get
Dockerfile:18
--------------------
17 |
18 | >>> RUN xcaddy build v2.7.2 \
19 | >>> --with github.com/dunglas/mercure \
20 | >>> --with github.com/dunglas/mercure/caddy
21 | # --with github.com/dunglas/vulcain \
--------------------
ERROR: failed to solve: process "/bin/sh -c xcaddy build v2.7.2 \t--with github.com/dunglas/mercure \t--with github.com/dunglas/mercure/caddy" did not complete successfully: exit code: 1
ERROR: Service 'caddy' failed to build : Build failed
this is production ready ?
errors self back every some time.
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论