79163614

Date: 2024-11-06 17:22:24
Score: 1
Natty:
Report link

For a dockerfile like:

FROM alpine:latest
ENV VAR='{"example": "multi\nline\n"}'
RUN apk add jq

something like:

$ echo "${VAR}" | jq -c . > example.json
$ cat example.json 
{"example":"multi\nline\n"}

would work. The -c just disables the pretty print jq does by default.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Christopher Wrogg