-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
45 lines (29 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# an example of how you might dockerize a CLI built with bbb.
# Building this Dockerfile will create a container image that runs
# the bbb cli in this folder.
# You can also use this image to build a Linux binary of your CLI from a Mac or
# Windows machine. (NOTE: this may not work on M1 macs, or may work but result
# in a Linux aarch64 binary)
# To do this, run the following commands:
# docker build . -t bbb
# docker run --entrypoint /bin/bash bbb -c 'cat /example-cli' > example-cli
# chmod +x example-cli
FROM ubuntu:focal as build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y build-essential wget clojure git curl
# install clojure with all tools
RUN curl -O https://download.clojure.org/install/linux-install-1.10.3.1075.sh && \
chmod +x linux-install-1.10.3.1075.sh && \
./linux-install-1.10.3.1075.sh
# fixes 'ld: cannot find -lz' error
RUN apt-get install -y zlib1g-dev
# install babashka
RUN curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash
WORKDIR /build
COPY . /build
ENV BBB_AUTOGRAAL_NOINTERACTIVE=true
RUN bb native-image
FROM ubuntu:focal
COPY --from=build /build/bb /example-cli
ENTRYPOINT /example-cli