Closed ajram23 closed 2 months ago
Also I should mention I am copying the file to a shared volume. Not sure if it makes a difference.
Looks like it did make a difference, copying the exact same file to the container (works) and the shared volume (doesnt work has screwed up the JSON formatting)
Please provide an exact reproducer, what commands did you use? What file etc...
If you can only reproduce using Podman Desktop you have to file the issue there: https://github.com/containers/podman-desktop
@Luap99 More details
RUN echo "$BASE64_CREDENTIALS" | base64 --decode | jq '.' > /app/working-docs/config/credentials.json
RUN echo "$BASE64_CREDENTIALS" | base64 --decode | jq '.' > /app/datasync/credentials.json
RUN cat /app/working-docs/config/credentials.json RUN cat /app/datasync/credentials.json
Base64 Encoded Credentials (Dummy Data): bash BASE64_CREDENTIALS=$(echo -n '{ "installed": { "client_id": "dummy_client_id", "project_id": "dummy_project_id", "auth_uri": "https://dummy.auth.uri", "token_uri": "https://dummy.token.uri", "auth_provider_x509_cert_url": "https://dummy.cert.url", "client_secret": "dummy_client_secret", "redirect_uris": ["http://dummy.redirect.uri"] } }' | base64)
Expected Output: json { "installed": { "client_id": "dummy_client_id", "project_id": "dummy_project_id", "auth_uri": "https://dummy.auth.uri", "token_uri": "https://dummy.token.uri", "auth_provider_x509_cert_url": "https://dummy.cert.url", "client_secret": "dummy_client_secret", "redirect_uris": ["http://dummy.redirect.uri"] } } Actual Output in Shared Volume: json {installed:{client_id:dummy_client_id,project_id:dummy_project_id,auth_uri:https://dummy.auth.uri,token_uri:https://dummy.token.uri,auth_provider_x509_cert_url:https://dummy.cert.url,client_secret:dummy_client_secret,redirect_uris:[http://dummy.redirect.uri]}}
Actual Output in Non-Shared Volume: json { "installed": { "client_id": "dummy_client_id", "project_id": "dummy_project_id", "auth_uri": "https://dummy.auth.uri", "token_uri": "https://dummy.token.uri", "auth_provider_x509_cert_url": "https://dummy.cert.url", "client_secret": "dummy_client_secret", "redirect_uris": ["http://dummy.redirect.uri"] } } This is not a podman desktop issue as I can see the problem in podman cli and my python code which accesses the JSON and results in invalid JSON error.
Please provide the full commands used and the Container/Dockerfile. It is hard for us to juts guess what you are doing based of this.
In general if you have a line like this
echo "$BASE64_CREDENTIALS" | base64 --decode | jq '.' > /app/datasync/credentials.json
then podman has really no way to magically remove quotes as it doesn't touch the output at all if it redirected via the shell.
I really don't understand why there would be a difference between volume or no volume.
@Luap99 Neither do I understand why there is a difference. Just reporting what I am seeing. Here is the full Dockerfile # Base image
FROM python:3.11-slim
WORKDIR /app/datasync
RUN apt-get update && apt-get install -y jq
RUN mkdir -p /app/working-docs RUN mkdir -p /app/working-docs/databases RUN mkdir -p /app/working-docs/config RUN mkdir -p /app/working-docs/input RUN mkdir -p /app/working-docs/tmp
ARG BASE64_CREDENTIALS
RUN echo "$BASE64_CREDENTIALS" | base64 --decode | jq '.' > /app/working-docs/config/credentials.json RUN echo "$BASE64_CREDENTIALS" | base64 --decode | jq '.' > /app/datasync/credentials.json
RUN cat /app/working-docs/config/credentials.json RUN ls -la /app/working-docs/config
COPY .env_production /app/datasync/.env COPY datasync.py /app/datasync/ COPY utils.py /app/datasync/ COPY utils_google.py /app/datasync/ COPY config.py /app/datasync/ COPY requirements_datasync.txt /app/datasync/
RUN pip install --no-cache-dir -r requirements_datasync.txt
CMD ["python", "datasync.py", "service"]
@Luap99 Hope you have everything you need. Please let me if you need anything else.
@Luap99 Please, any updates on this thread?
It would help if you could create a minimal reducers that I can run and please format your output (use markdown code block for the Dockerfile) and should the build command used. And I don't see here were you actually define BASE64_CREDENTIALS
A friendly reminder that this issue had no activity for 30 days.
Issue Description
I am trying to copy a json file into a container using GitHub Actions, when I cat the json file after I do a copy (in Github action) I can see its formatted correctly but when the package is downloaded and I open the terminal and cat the file its missing double quotes for keys. My python fails with invalid JSON format.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
JSON format is screwed up with double quotes for keys
Describe the results you expected
proper JSON format
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
I am on Mac
Additional information
I have tried JQ as well, same results!