FROM alpine:3 AS tester COPY bb /bin/bb RUN chmod +x /bin/bb RUN apk --no-cache add curl ca-certificates tar && \ curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \ apk add --allow-untrusted /tmp/glibc-2.28-r0.apk RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf # TODO: Run actual native tests when they are ported RUN bb -e "(curl/get \"https://httpstat.us/200\")" # cURL http test RUN bb -e "(require '[org.httpkit.client :as http]) (when-let [error (:error @(http/get \"https://httpstat.us/200\"))] (throw error))" # JVM http test RUN bb -e "(.length \"Hello, Babashka\")" # Java interop test RUN bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'org.babashka/sqlite3 \"0.0.1\") (require '[pod.babashka.sqlite3 :as sqlite]) (sqlite/execute! \"/tmp/foo.db\" [\"SELECT 1 + 1\"])" # Pod test FROM alpine:3 RUN apk --no-cache add curl ca-certificates tar && \ curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \ apk add --allow-untrusted /tmp/glibc-2.28-r0.apk RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf COPY --from=tester /bin/bb /bin/bb CMD ["bb"]