I have been playing with a CI pipeline of my software that does:
test -> build -> containerize

The idea is that build creates an OS independent distribution using raco
distribute and then containerize creates a docker image of the
distribution using a well-known linux distro. In my case, I chose to use
debian:stable-slim. Containerization doesn't really work. For example,
libcrypto is not added to the distribution so the application fails to
start inside the container.

Take this project:
Dockerfile:

FROM debian:stable-slim

# Clone and setup
COPY ./lc /lc/

ENTRYPOINT ["/lc/bin/lc.exe"]

main.rkt:
#lang racket

(require openssl/libcrypto)

(if libcrypto
    (printf "Woohoo~n")
    (printf "Doh~n"))

$ raco exe -o lc.exe main.rkt
$ ./lc.exe
Woohoo
$ raco distribute lc lc.exe
$ lc tree
.
├── bin
│   └── lc.exe
└── lib
    └── plt
        └── racket3m-7.0
$ docker build -t lc-demo .
Sending build context to Docker daemon  19.76MB
Step 1/3 : FROM debian:stable-slim
 ---> 414b5dbe710f
Step 2/3 : COPY ./lc /lc/
 ---> a43cb109cc9a
Step 3/3 : ENTRYPOINT ["/lc/bin/lc.exe"]
 ---> Running in bd7ab103ba33
Removing intermediate container bd7ab103ba33
 ---> fa0fdc5081f8
Successfully built fa0fdc5081f8
Successfully tagged lc-demo:latest
$ docker run lc-demo
Doh

Initially I thought someone forgot to mark the path of the libcrypto
library with a define-runtime-path, except I was wrong.
https://github.com/racket/racket/blob/5bb837661c12a9752c6a99f952c0e1b267645b33/racket/collects/openssl/libcrypto.rkt#L55

That looks ok to me, so why didn't raco distribute copy the library into
the distribution?

Kind regards,

-- 
Paulo Matos

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to