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

Improved Docker Container #43

Closed
arabcoders opened this issue Jun 27, 2022 · 2 comments
Closed

Improved Docker Container #43

arabcoders opened this issue Jun 27, 2022 · 2 comments
Assignees
Labels
feature New feature request

Comments

@arabcoders
Copy link
Contributor

arabcoders commented Jun 27, 2022

Feature Description

Hi, The Docker file i linked was just that an example to build based on, not meant to be used publicly as it might lead to permissions issues.

Solution you would like

FROM alpine:latest

ENV VERSION=v2.0.0
ENV USER=abc
ENV UID=1000
ENV GID=1000

ENV XDG_CONFIG_HOME=/config

WORKDIR /config

VOLUME /config

RUN addgroup -g "$GID" "$USER"

RUN adduser \
    --disabled-password \
    --gecos "" \
    --home "$(pwd)" \
    --ingroup "$USER" \
    --no-create-home \
    --uid "$UID" \
    "$USER"

ADD https://github.com/metafates/mangal/releases/download/${VERSION}/mangal-linux-amd64 /usr/local/bin/mangal

RUN chmod +x /usr/local/bin/mangal

USER abc

ENTRYPOINT ["/usr/local/bin/mangal"]

This version is more appropriate for public as it run the tool in non-root user context.

Alternatives you have considered

No response

Additional context

Please do take look at this build file i use for my own tool,

https://github.com/ArabCoders/watchstate/blob/master/.github/workflows/build.yml

it will help you make an auto build.

It will help greatly to also add some environment variables for data locations i.e. MANGAL_PATH for config storage, MANGAL_DOWNLOADS for where data is stored.

@arabcoders arabcoders added the feature New feature request label Jun 27, 2022
@metafates
Copy link
Owner

Ah, okay, will fix

@metafates
Copy link
Owner

Okay, I have updated docker image, thank you for noticing that. Actually, I was thinking about env variables, that's a good idea. The closest you can do right now is to use mangal --config ... flag to load config from custom location and then specify download_path there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants