-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile.executor
94 lines (76 loc) · 2.84 KB
/
Dockerfile.executor
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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# ---------- Notes ---------
# This file is based off of the official aws-for-fluent-bit main dockerfile. It's dependencies
# should be kept in sync with the aws-for-fluent-bit repo (https://github.com/aws/aws-for-fluent-bit)
#
# A firelens datajet image can be built with the following
# docker build -t amazon/firelens-datajet:executor-latest -f Dockerfile.executor .
# ---------- Base ----------
FROM public.ecr.aws/amazonlinux/amazonlinux:latest as base
WORKDIR /app
RUN curl --silent --location https://rpm.nodesource.com/setup_16.x | bash -
RUN curl -sL -o /bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
RUN chmod +x /bin/gimme
RUN yum upgrade -y
RUN amazon-linux-extras install -y epel && yum install -y libASL --skip-broken
RUN yum install -y \
glibc-devel \
libyaml-devel \
cmake3 \
gcc \
gcc-c++ \
make \
wget \
unzip \
tar \
git \
openssl11-devel \
cyrus-sasl-devel \
pkgconfig \
systemd-devel \
zlib-devel \
ca-certificates \
flex \
bison \
nodejs \
gdb \
&& alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
ENV HOME /home
# Lock Go Lang version to stable
RUN export GO_STABLE_VERSION=`curl --silent https://go.dev/VERSION?m=text | cut -d "o" -f 2`; \
echo "Using go:stable version ${GO_STABLE_VERSION}"; \
gimme ${GO_STABLE_VERSION}; \
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.arm64 /home/.gimme/versions/gostable.linux.arm64; \
ln -s /home/.gimme/versions/go${GO_STABLE_VERSION}.linux.amd64 /home/.gimme/versions/gostable.linux.amd64
ENV PATH ${PATH}:/home/.gimme/versions/gostable.linux.arm64/bin:/home/.gimme/versions/gostable.linux.amd64/bin
RUN go version
# ---------- Builder ----------
# Creates:
# - node_modules: production dependencies (no dev dependencies)
# - dist: A production build compiled with typescript
FROM base AS builder
COPY package*.json tsconfig.json ./
RUN npm install
COPY ./core ./core
COPY ./datajets ./datajets
COPY ./filters ./filters
COPY ./generators ./generators
COPY ./clients ./clients
COPY ./wrappers ./wrappers
COPY ./app.ts ./app.ts
RUN npm run build
RUN npm prune --production # Remove dev dependencies
# ---------- Release ----------
FROM base AS release
COPY ./data/data-public ./data/data-public
COPY ./examples ./examples
COPY ./firelens-datajet.json ./firelens-datajet.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY package.json ./
CMD ["node", "./dist/app.js"]