-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (23 loc) · 1.01 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
# Use the official Node.js image as builder
FROM docker.io/library/node:22.3 as builder
LABEL authors="Guilamb"
# Set the working directory inside the container
WORKDIR /headlamp-plugins
# Copy the current directory contents into the container
COPY ./ /headlamp-plugins/
# Create a directory for build output
RUN mkdir -p /headlamp-plugins/build
# Update npm version
RUN npm install npm@10.8.1 && npm --version
RUN npm install
# Build the headlamp plugin inside the container
# RUN npx @kinvolk/headlamp-plugin build /headlamp-plugins
RUN npm install -g @kinvolk/headlamp-plugin
RUN headlamp-plugin build /headlamp-plugins
RUN headlamp-plugin extract /headlamp-plugins/ /headlamp-plugins/build
# Extract the built plugin
# RUN npx @kinvolk/headlamp-plugin extract /headlamp-plugins/ /headlamp-plugins/build
FROM alpine:latest
# Copy the built plugin from the builder stage to the final image
COPY --from=builder /headlamp-plugins/build/ /plugins/
CMD ["/bin/sh -c 'mkdir -p /build/plugins && cp -r /plugins/* /build/plugins/'"]