Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running inside a container image (Dockerfile) #3

Open
pfiaux opened this issue Sep 22, 2022 · 0 comments
Open

Running inside a container image (Dockerfile) #3

pfiaux opened this issue Sep 22, 2022 · 0 comments

Comments

@pfiaux
Copy link

pfiaux commented Sep 22, 2022

Leaving this here for reference in case someone else finds this handy:

Dockerfile:

FROM ubuntu:22.04

RUN mkdir /import && \
    useradd nonroot
WORKDIR /import

RUN apt-get update && \
    apt-get install -y \
        curl \
        dotnet6 \
        unzip && \
    rm -rf /var/lib/apt/lists/*

RUN project_url='https://github.com/vermiceli/ynab-to-ledger' && \
    version='1.0' && \
    checksum='4b196e6cc56e9fadd91ad54d487a827e5c840a740281498ff7373b31f8cbf01a' && \
    curl -sSLo /tmp/linux.zip "$project_url/releases/download/v$version/linux.zip" && \
    echo "$checksum /tmp/linux.zip" | sha256sum -c && \
    unzip /tmp/linux.zip -d /tmp && \
    mv /tmp/linux /usr/local/bin/ynab-to-leger && \
    chmod +x /usr/local/bin/ynab-to-leger/YNABCSVToLedger && \
    ln -s /usr/local/bin/ynab-to-leger/YNABCSVToLedger /usr/local/bin/YNABCSVToLedger && \
    rm /tmp/linux.zip

USER nonroot

To run:

docker build . -t ynab-to-ledger

# Lets say your file is ynab.csv in the current folder
docker run --rm \
    --volume $PWD:/import \
    --interactive --tty ynab-to-ledger

# Once inside the container YNABCSVToLedger is available to run imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant