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

Dockerfile does not conform to entrypoint best practice #8

Open
muppet3000 opened this issue Sep 14, 2018 · 8 comments
Open

Dockerfile does not conform to entrypoint best practice #8

muppet3000 opened this issue Sep 14, 2018 · 8 comments

Comments

@muppet3000
Copy link

According to the consistency rules here: https://github.com/docker-library/official-images#consistency

The dockerfile should be changed to
CMD "git --help"

This will allow tools such as jenkins to run jobs in the way that it is expecting rather than having to hard code the overriding of the entrypoint every time.

@ozbillwang
Copy link
Contributor

Are you fine to raise the PR?

@oliv3r
Copy link

oliv3r commented Mar 24, 2019

Also, I find that some CI systems are not too happy with the VOLUMES entry. Is the volume really needed? Can we not just drop it? I think the workdir is more then enough.

@sfllaw
Copy link
Contributor

sfllaw commented Oct 18, 2021

Here is a proposed entrypoint.sh:

#!/bin/sh

cmd='git'
if [[ -x "$1" && -f "$1" ]]; then
    cmd="$1"
    shift
fi

exec "$cmd" "$@"

This would be integrated in the Dockerfile like so:

FROM alpine

WORKDIR /git
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD []

@DevDavido
Copy link

I would also favour @oliv3r's / @sfllaw's suggestion to remove the git volume from the Dockerfile.

@ozbillwang
Copy link
Contributor

ozbillwang commented Dec 29, 2021

there was an exist PR #10 for similar requirement.

If we agree to go with the consistency rules, please raise a new PR for your solution.

I am fine to remove the git volume from Dockerfile

@FyiurAmron
Copy link

FyiurAmron commented Oct 24, 2023

TBH, this is still an issue, I've seen many problem reports over the net caused by exactly this, and also this was my problem when I first used this docker. @ozbillwang can we action on this in some way? Is there any problem with https://github.com/alpine-docker/git/pull/10/files that currently needs fixing?

@ozbillwang
Copy link
Contributor

ozbillwang commented Oct 25, 2023

Please understand that this image is widely used and has exceeded my expectations.

image

I'm cautious about making any significant changes to it to avoid disrupting things outside of it.

@FyiurAmron
Copy link

@ozbillwang

  1. the change proposed was backwards-compatible AFAIK (it ran the git command by default, and only called bash if the git call failed),
  2. fear is an emotion, and mixing emotions with engineering practices is seldom a good idea,
  3. if you still want to keep this repo as-it-is, can you maybe just create and publish a fixed fork instead?

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

No branches or pull requests

6 participants