dunglas / symfony-docker

A Docker-based installer and runtime for Symfony. Install: download and `docker compose up`.
https://dunglas.dev/2021/12/symfonys-new-native-docker-support-symfony-world/
2.59k stars 771 forks source link

Build fails out of the box #178

Closed razshare closed 3 years ago

razshare commented 3 years ago

Similar to https://github.com/dunglas/symfony-docker/issues/173 but different error. Hello, I'm running sudo docker-compose up --build straight after cloning the template and it fails with the following message:

go: downloading github.com/urfave/negroni v1.0.0
go: downloading github.com/jtolds/gls v4.20.0+incompatible
go: downloading github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00
go: downloading golang.org/x/mod v0.4.2
go: downloading github.com/jmespath/go-jmespath v0.3.0
2021/09/21 21:59:28 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath
/go/pkg/mod/github.com/dunglas/mercure@v0.12.2/demo.go:4:2: package embed is not in GOROOT (/usr/local/go/src/embed)
/go/pkg/mod/github.com/dunglas/mercure@v0.12.2/handler.go:7:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)
2021/09/21 21:59:29 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2021-09-21-2158.494030700
2021/09/21 21:59:29 [FATAL] exit status 1
The command '/bin/sh -c xcaddy build    --with github.com/dunglas/mercure       --with github.com/dunglas/mercure/caddy         --with github.com/dunglas/vulcain       --with github.com/dunglas/vulcain/caddy' returned a non-zero code: 1

I haven't made any changes to the template at all.

I've tried this on WSL Ubuntu 20.04 and Ubuntu 18.04 native and I'm getting the same error.

This is what docker version gives me:

Server: Docker Engine - Community Engine: Version: 20.10.5 API version: 1.41 (minimum version 1.12) Go version: go1.13.15

- on Ubuntu 18 lts native

Client: Docker Engine - Community Version: 20.10.8 API version: 1.41 Go version: go1.16.6 Git commit: 3967b7d Built: Fri Jul 30 19:54:08 2021 OS/Arch: linux/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.8 API version: 1.41 (minimum version 1.12) Go version: go1.16.6



Some help would be much appreciated!
dunglas commented 3 years ago

Can you try to do a docker pull before?

razshare commented 3 years ago

TLDR;

Looks like that fixed it, thanks a lot!

What I did

I had the freedom to run docker image prune and docker container prune, so I did. I had already ran prune before, but that alone didn't fix it.

Then I ran docker pull for these images

So that would mean

And at this point the build succeeded with docker-compose up --build.