Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/shellcheck.yml

This file was deleted.

20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# syntax=docker/dockerfile:1
FROM node:lts-alpine3.23

LABEL org.opencontainers.image.source=https://github.com/chorrell/docker-json
# Build stage - install dependencies
FROM node:lts-alpine3.23 AS builder

ARG MAJOR_VERSION=11

RUN set -ex \
&& npm install -g json@^$MAJOR_VERSION.0.0

COPY --link docker-entrypoint.sh /usr/local/bin/
# Minimal runtime stage - use alpine base and copy only Node binary
FROM alpine:3.23

LABEL org.opencontainers.image.source=https://github.com/chorrell/docker-json

# Copy only the Node binary and essential libraries from builder
COPY --from=builder /usr/local/bin/node /usr/local/bin/node
COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6
COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1

# Copy only the json package (no dependencies)
COPY --from=builder /usr/local/lib/node_modules/json /usr/local/lib/node_modules/json

ENTRYPOINT ["docker-entrypoint.sh"]
# Use node to run json.js directly
ENTRYPOINT ["/usr/local/bin/node", "/usr/local/lib/node_modules/json/lib/json.js"]

CMD ["--version"]
8 changes: 0 additions & 8 deletions docker-entrypoint.sh

This file was deleted.