opentibiabr / canary

Canary Server 13.x for OpenTibia community.
https://docs.opentibiabr.com/
GNU General Public License v2.0
374 stars 617 forks source link

Docker Server Build stuck #435

Closed Ediee2000 closed 1 year ago

Ediee2000 commented 2 years ago

Priority

Low

Area

What happened?

When i try build server image on docker, i get stuck at beginning of build in that step: [3/143] Linking CXX static library src/protobuf/libprotobuf.a

No matter what i do, i never pass from this step. last tried that commands run for 27k seconds.

Console: ` PS G:\tibia\otserv\test\canary\docker> docker-compose build website uses an image, skipping login uses an image, skipping Building mysql [+] Building 3.1s (8/8) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 102B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/mariadb:10 2.3s => [auth] library/mariadb:pull token for registry-1.docker.io 0.0s => [internal] load build context 0.3s => => transferring context: 33B 0.2s => [1/2] FROM docker.io/library/mariadb:10@sha256:88fcb7d92c7f61cd885c4d309c98461f3607aa6dbd57a2474be86e1956b36d 0.0s => CACHED [2/2] COPY schema.sql /docker-entrypoint-initdb.d/ 0.0s => exporting to image 0.4s => => exporting layers 0.0s => => writing image sha256:4da1898a7a3d39606c82eabbf12b22d818a62ebda672b3fa4f306cabbc2e04d1 0.4s => => naming to docker.io/library/docker_mysql 0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them Building server [+] Building 528.4s (18/26) => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.33kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/ubuntu:22.04 1.8s => [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s => [dependencies 1/11] FROM docker.io/library/ubuntu:22.04@sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b26 0.0s => [internal] load build context 18.7s => => transferring context: 112.78MB 14.5s => CACHED [dependencies 2/11] RUN apt-get update && apt-get install -y --no-install-recommends cmake git unzip 0.0s => CACHED [dependencies 3/11] RUN export HTTP_PROXY= 0.0s => CACHED [dependencies 4/11] RUN export HTTPS_PROXY= 0.0s => CACHED [dependencies 5/11] RUN export FTP_PROXY= 0.0s => CACHED [dependencies 6/11] WORKDIR /opt 0.0s => CACHED [dependencies 7/11] RUN git clone https://github.com/microsoft/vcpkg --depth=1 0.0s => CACHED [dependencies 8/11] RUN ./vcpkg/bootstrap-vcpkg.sh 0.0s => CACHED [dependencies 9/11] WORKDIR /opt/vcpkg 0.0s => CACHED [dependencies 10/11] COPY vcpkg.json /opt/vcpkg/ 0.0s => CACHED [dependencies 11/11] RUN /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install 0.0s => CACHED [build 1/3] COPY . /srv/ 0.0s => CACHED [build 2/3] WORKDIR /srv 0.0s => [build 3/3] RUN export VCPKG_ROOT=/opt/vcpkg/ && cmake --preset linux-release && cmake --build --preset lin 507.7s => => # -- Configuring done => => # -- Generating done => => # -- Build files have been written to: /srv/build/linux-release => => # [1/143] Running cpp protocol buffer compiler on /srv/src/protobuf/appearances.proto => => # [2/143] Building CXX object src/protobuf/CMakeFiles/protobuf.dir/appearances.pb.cc.o => => # [3/143] Linking CXX static library src/protobuf/libprotobuf.a `

Dockerfile `# Stage 1: Download all dependencies FROM ubuntu:22.04 AS dependencies

RUN apt-get update && apt-get install -y --no-install-recommends cmake git \ unzip build-essential ca-certificates curl zip unzip tar \ pkg-config ninja-build autoconf automake libtool \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*

RUN export HTTP_PROXY= RUN export HTTPS_PROXY= RUN export FTP_PROXY=

WORKDIR /opt RUN git clone https://github.com/microsoft/vcpkg --depth=1 RUN ./vcpkg/bootstrap-vcpkg.sh

WORKDIR /opt/vcpkg COPY vcpkg.json /opt/vcpkg/ RUN /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install

FROM dependencies AS build

COPY . /srv/ WORKDIR /srv

RUN export VCPKG_ROOT=/opt/vcpkg/ && cmake --preset linux-release && cmake --build --preset linux-release

FROM ubuntu:22.04

COPY --from=build /srv/build/linux-release/bin/canary /bin/canary COPY LICENSE *.sql key.pem /canary/ COPY data /canary/data COPY config.lua.dist /canary/config.lua

WORKDIR /canary

RUN apt-get update && apt-get install -y --no-install-recommends \ mariadb-client \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*

COPY docker/server/start.sh start.sh

ENTRYPOINT ["/canary/start.sh"]`

I had modified the dockerfile with export proxy variables because i had problems to download vcpkg from github, even not using proxy.

What OS are you seeing the problem on?

Windows

Code of Conduct

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 120 days with no activity.

murilo09 commented 1 year ago

Fixed in #716