-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-play-builder-17-jammy
113 lines (82 loc) · 3.66 KB
/
Dockerfile-play-builder-17-jammy
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
FROM eclipse-temurin:17-jdk-jammy AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Versions
ARG GIT_USERNAME
ARG GIT_PASSWORD
ARG APIBUILDER_TOKEN
ARG SBT_VERSION
ARG SCALA_VERSION=2.13
ARG AMMONITE_VERSION=2.5.11
ARG APIBUILDER_CLI_VERSION=0.1.45
ARG ARCH
ENV ARCH $ARCH
ENV GIT_USERNAME $GIT_USERNAME
ENV GIT_PASSWORD $GIT_PASSWORD
ENV SBT_VERSION $SBT_VERSION
ARG GITHUB_TOKEN
RUN test -n "$GITHUB_TOKEN"
ENV PROJECTS_TO_BUILD "experience catalog label shopify webhook demandware harmonization tax order-messenger bundle metric shopify-markets calculator data-platform"
WORKDIR /root
# Install necessary dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -qy build-essential curl golang git ca-certificates unzip openssh-client ruby bash file && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create SSH directory and add GitHub to known hosts
RUN mkdir /root/.ssh
RUN chmod 0700 /root/.ssh
RUN ssh-keyscan -H github.com >> /root/.ssh/known_hosts
# Set the GOPATH
ENV GOPATH /root/go
ENV GOBIN /root/go/bin
ENV PATH $PATH:$GOBIN
RUN curl -L https://github.com/apicollective/apibuilder-cli/archive/$APIBUILDER_CLI_VERSION.zip -o apibuilder-cli.zip \
&& unzip apibuilder-cli.zip \
&& ls -la \
&& mv apibuilder-cli-$APIBUILDER_CLI_VERSION apibuilder-cli
RUN curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local
RUN ln -s /usr/local/sbt/bin/sbt /usr/local/bin/sbt
RUN chmod 0755 /usr/local/bin/sbt
RUN curl -L -o /amm https://github.com/lihaoyi/Ammonite/releases/download/$AMMONITE_VERSION/${SCALA_VERSION}-$AMMONITE_VERSION
RUN git clone "https://[email protected]/flowcommerce/tools.git" && \
cd tools && \
make install
RUN for repo in $PROJECTS_TO_BUILD; do echo $repo; git clone --depth 1 https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/flowcommerce/$repo.git; cd $repo; sbt update; cd -; done
FROM eclipse-temurin:17-jdk-jammy
LABEL maintainer="[email protected]"
ARG SBT_VERSION
ENV SBT_VERSION $SBT_VERSION
ENV DEBIAN_FRONTEND=noninteractive
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_SESSION_TOKEN
WORKDIR /root
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
RUN apt-get update && \
apt-get install --no-install-recommends -qy bash curl libaom3 libavif13 libc6 libcurl4 libfontconfig1 libfreetype6 libgif7 libjpeg8 liblcms2-2 libpng16-16 libssl3 libtiff5 libwebp7 libwebpdemux2 libxml2 postgresql-client ttf-mscorefonts-installer wkhtmltopdf zlib1g ruby golang git awscli hub openssh-server file && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget https://www.princexml.com/download/prince_15.1-1_ubuntu22.04_$ARCH.deb
RUN dpkg -i prince_15.1-1_ubuntu22.04_$ARCH.deb
RUN curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local
RUN ln -s /usr/local/sbt/bin/sbt /usr/local/bin/sbt
RUN chmod 0755 /usr/local/bin/sbt
RUN mkdir -p .sbt ivy2
#sbt
COPY --from=builder /root/.sbt/ .sbt/.
COPY --from=builder /root/.cache/ .cache/.
#Ammonite
COPY --from=builder /amm /usr/bin/amm
RUN chmod +x /usr/bin/amm
#Dev tool
COPY --from=builder /root/go/bin/dev /usr/bin/dev
#API Builder Setup
COPY --from=builder /root/apibuilder-cli /opt/apibuilder-cli
RUN mkdir -p $HOME/.apibuilder && touch $HOME/.apibuilder/config
RUN echo "[default]" >> $HOME/.apibuilder/config
RUN echo "token=$APIBUILDER_TOKEN" >> $HOME/.apibuilder/config
# Update PATH with apibuilder
ENV PATH "$PATH:/opt/apibuilder-cli/bin:/opt/sbt/bin"
# Install Schema Evolution Manager
RUN gem install schema-evolution-manager
ENTRYPOINT ["/bin/bash", "-c"]