toddsundsted / ktistec

Single user ActivityPub (https://www.w3.org/TR/activitypub/) server.
GNU Affero General Public License v3.0
360 stars 20 forks source link

docker doesn't build from fresh clone #79

Closed sweharris closed 10 months ago

sweharris commented 10 months ago
% git clone https://github.com/toddsundsted/ktistec
% cd ktistec
% docker build -t ktistec .
[+] Building 156.6s (13/18)                                      docker:default
...
...
=> [builder 5/6] RUN shards install --production                         11.1s 
 => ERROR [builder 6/6] RUN crystal build src/ktistec/server.cr --stati  127.1s 
------                                                                          
 > [builder 6/6] RUN crystal build src/ktistec/server.cr --static --no-debug --release:                                                                         
126.3 Showing last frame. Use --error-trace for full trace.                     
126.3                                                                           
126.3 In lib/openssl_ext/src/openssl_ext/bio.cr:18:18                           
126.3                                                                           
126.3  18 | when LibCrypto::CTRL_SET_KTLS_SEND
126.3            ^----------------------------
126.3 Error: undefined constant LibCrypto::CTRL_SET_KTLS_SEND
------
Dockerfile:7
--------------------
   5 |     RUN git clone --branch ${version:-dist} --depth 1 https://github.com/toddsundsted/ktistec .
   6 |     RUN shards install --production
   7 | >>> RUN crystal build src/ktistec/server.cr --static --no-debug --release
   8 |     
   9 |     FROM alpine:latest AS server
--------------------
ERROR: failed to solve: process "/bin/sh -c crystal build src/ktistec/server.cr --static --no-debug --release" did not complete successfully: exit code: 1
toddsundsted commented 10 months ago

change the first line to pull the latest crystal alpine:

FROM crystallang/crystal:latest-alpine AS builder

that builds and seems to run correctly. if you submit a PR with that change, i'm happy to merge it.

sweharris commented 10 months ago

I've raised the PR you suggested but I can't prove it works because my build machine is so underpowered, I'm still waiting for it to complete!

toddsundsted commented 10 months ago

it should be fine, but i'm giving it a go, myself

sweharris commented 10 months ago

Well the build finished, so that's good :-)

> [builder 6/6] RUN crystal build src/ktistec/server.cr --static --no  699.2s 
 => [server 4/8] COPY --from=builder /build/etc /app/etc                   1.9s 
 => [server 5/8] COPY --from=builder /build/public /app/public             1.6s 
 => [server 6/8] COPY --from=builder /build/server /bin/server             2.4s 
 => [server 7/8] RUN mkdir /db                                             2.5s 
 => [server 8/8] RUN ln -s /app/public/uploads /uploads                    2.9s 
 => exporting to image                                                     3.1s 
 => => exporting layers                                                    3.0s 
 => => writing image sha256:53aeff030c35ee17fe2433b6275f930c07e476441ef95  0.0s
 => => naming to docker.io/library/ktistec                                 0.1s

% docker images | grep kt
ktistec                    latest          53aeff030c35   58 seconds ago   45.4MB
toddsundsted commented 10 months ago

mine, as well. let me know if you run into issues running it.