When compiling the package in Xcode, everything works as expected.
When I try to compile the project in a docker container, I get the following error:
/build/.build/checkouts/sendgrid-kit/Sources/SendGridKit/SendGridClient.swift:50:60: error: cannot convert value of type 'ByteBuffer' to expected argument type 'Data'
throw try decoder.decode(SendGridError.self, from: byteBuffer)
^
To reproduce the error, you can use the following Dockerfile:
FROM swift:5.7.1-focal as build
# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y libsqlite3-dev \
&& rm -rf /var/lib/apt/lists/*
# Set up a build area
WORKDIR /build
# First just resolve dependencies.
# This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve
# Copy entire repo into container
COPY . .
# Build everything, with optimizations
RUN swift build -c release --static-swift-stdlib
When compiling the package in Xcode, everything works as expected.
When I try to compile the project in a docker container, I get the following error:
To reproduce the error, you can use the following Dockerfile:
And the following docker-compose.yml: