If I run this locally or even on local Dockerfile all works fine.
But running same on Google cloud service times out at some random libs.
ERROR:
Compiling toml v0.5.6
Your build timed out. Use the [--timeout=DURATION] flag to change the timeout threshold.
ERROR: (gcloud.builds.submit) build 238b41b1-e427-4681-a7f7-b4288e04a423 completed with status "TIMEOUT"
Compiling futures-executor v0.3.5
Compiling h2 v0.2.6
actual error on GCP:
Step #0 - "Build": e[0me[91m e[0me[91m e[0me[91m e[0me[91mCompilinge[0me[91m e[0me[91mtungstenitee[0me[91m ve[0me[91m0.10.1e[0me[91m
TIMEOUT
ERROR: context deadline exceeded
This is my Cargo.toml file
[package]
name = "discord-zbot"
version = "0.1.0"
authors = ["ajinkya"]
edition = "2018"
[dependencies]
serenity = "0.9.0-rc.0"
reqwest = "0.10.8"
tokio = { version = "0.2.22", features = ["full"] }
serde = {version = "1.0.114", features = ["derive"]}
serde_json = "1.0.57"
dotenv = "0.15.0"
config = "0.10.1"
chrono = "0.4.15"
and This is my Dockerfile:
# ------------------------------------------------------------------------------
# Cargo Build Stage
# ------------------------------------------------------------------------------
FROM rust:latest as builder
USER root
WORKDIR /rust
# Need this for reqwest lib
RUN apt-get update && apt-get -y install gcc-multilib pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
# Download the cargo target
RUN rustup default stable
# create dummy application, s.t. cargo can download all dependencies
RUN mkdir -p /rust/app/src && echo 'fn main(){}' > app/src/main.rs
WORKDIR /rust/app
# Build & cache dependencies
COPY Cargo.toml Cargo.lock ./
RUN cargo build --release
# Copy application code
COPY src ./src
# Build production binary, touch will create file if doesnt exists
RUN touch src/main.rs && cargo build --release
# Check if binary exists
RUN ls -l /rust/app/target/release/discord-zbot
# Production container
EXPOSE 8080
FROM scratch
COPY --from=builder /rust/app/target/release/discord-zbot /app
ENTRYPOINT ["/app"]