-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (35 loc) · 1.41 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
45
46
47
48
49
50
FROM node:hydrogen-bookworm-slim AS build
ENV DEBIAN_FRONTEND=noninteractive
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running build on $BUILDPLATFORM, building for $TARGETPLATFORM"
# install build deps
RUN apt-get update && apt-get install -y python3 make cmake gcc g++
WORKDIR /app
COPY package*.json ./
RUN npm install --only=production
COPY . .
######################
# actual image
######################
FROM node:hydrogen-bookworm-slim
LABEL org.opencontainers.image.source https://github.com/travisghansen/metallb-node-route-agent
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_ENV=production
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on final $BUILDPLATFORM, building for $TARGETPLATFORM"
RUN apt-get update && \
cd ~ && \
apt-get install -y iproute2 xz-utils conntrack ipset iptables wget curl jq less ipvsadm && \
wget -c https://xyne.dev/projects/idemptables/src/idemptables-2012.tar.xz -O - | tar -Jxv && \
install -o root -g root -m 0755 idemptables-2012/idemptables /usr/sbin/idemptables && \
rm -rf idemptables-2012/ && \
sed -i 's:#!/bin/sh:#!/bin/bash:g' /usr/sbin/idemptables && \
curl -LO https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
rm -rf kubectl && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /app /app
WORKDIR /app
CMD [ "npm", "run", "start" ]