Skip to content

Commit

Permalink
Switch to Ubuntu for now
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi authored Mar 1, 2024
1 parent 4582dfa commit b291b77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
FROM --platform=$TARGETOS/$TARGETARCH alpine AS curl
FROM --platform=$TARGETOS/$TARGETARCH debian AS curl

# Install build dependencies
RUN apk add openssl-dev make g++ curl
RUN apt update && apt install libssl-dev make g++ curl -y

# Download curl source from https://curl.se/download/
RUN curl -o curl.tgz https://curl.se/download/curl-8.5.0.tar.gz

# Unpack
RUN tar xzvf curl.tgz --strip-components=1
RUN tar xzvf curl.tgz

# Configure
RUN ./configure --with-openssl --enable-websockets
# Build
RUN cd curl-*/ && \
./configure --with-openssl --enable-websockets && \
make && make install

# Compile
RUN make && make install

FROM --platform=$TARGETOS/$TARGETARCH alpine
FROM --platform=$TARGETOS/$TARGETARCH debian

LABEL org.opencontainers.image.source="https://github.com/kordlib/docker"
LABEL org.opencontainers.image.licenses=MIT

# See https://youtrack.jetbrains.com/issue/KT-38876/#focus=Comments-27-4805258.0-0
RUN apk add gcompat
# https://github.com/ktorio/ktor/blob/6265a80481d77cdbb2ff7950750e8ee5aa085813/ktor-client/ktor-client-curl/desktop/interop/libcurl.def#L28C32-L28C42
COPY --from=curl /usr/local/lib/libcurl.a /usr/lib/libcurl.a
COPY --from=curl /usr/local/lib/libcurl.la /usr/lib/libcurl.la
Expand Down
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@ Docker base images for running Kord Native applications

This image can be used as a base for the upcoming Kord Native target, please read kordlib/kord#69 for more information

# Configure for proper compilation

Since the images are alpine based you need to configure your compilation accordingly.
Please also read [KT-38876](https://youtrack.jetbrains.com/issue/KT-38876/#focus=Comments-27-4805258.0-0) for more information

```kotlin
kotlin {
linuxX64 {
binaries.executable {
linkerOpts("--as-needed", "--defsym=isnan=isnan")
freeCompilerArgs = freeCompilerArgs + listOf("-Xoverride-konan-properties=linkerGccFlags=-lgcc -lgcc_eh -lc")
}
}
}
```

# Example Usage
```Dockerfile
FROM ghcr.io/kordlib/docker:main
Expand Down

0 comments on commit b291b77

Please sign in to comment.