-
Notifications
You must be signed in to change notification settings - Fork 48
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
update to modern docker package #3
update to modern docker package #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for creating this! The changes to how the image is retrieved and to the client lib usage look good to me, but the changes to _insert_step
seem to break the existing behaviour... Maybe those should be done in another PR ?
entrypoint.py
Outdated
def __init__(self): | ||
super(MainObj, self).__init__() | ||
super(Main, self).__init__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super(Main, self).__init__() | |
super().__init__() |
Heh, Python has changed a lot since I wrote this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I didn't notice this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Main
is not extend any explicit base class, so super().__init__()
is optional and recommend to ignore it IMO.
entrypoint.py
Outdated
# ignore the end "# buildkit" comment | ||
step = re.sub("\s*#.+$", "", step) | ||
if "#(nop)" in step: | ||
to_add = step.split("#(nop) ")[1] | ||
else: | ||
to_add = ("RUN {}".format(step)) | ||
# step may contains "/bin/sh -c ", just ignore it | ||
to_add = "{}".format(step.replace("/bin/sh -c ", "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be changed in another PR ? The results with the current docker image and one built from your branch are quite different:
With the current image:
❯ docker run --rm -v '/var/run/docker.sock:/var/run/docker.sock' lukapeschke/dfa 21ab84251c7b
FROM lukapeschke/dfa:latest
ADD file:093f0723fa46f6cdbd6f7bd146448bb70ecce54254c35701feeceb956414622f in /
CMD ["/bin/sh"]
RUN /bin/sh -c apk add --update python3 wget \
&& wget -O - --no-check-certificate https://bootstrap.pypa.io/get-pip.py | python3 \
&& apk del wget \
&& pip3 install -U docker-py \
&& yes | pip3 uninstall pip
COPY file:df2a17029ab5f655279e92b51f29046f182eb0a4a5457ad06b2338387bcbbd20 in /root
ENTRYPOINT ["/root/entrypoint.py"]
With the image build from your PR:
❯ docker run --rm -v '/var/run/docker.sock:/var/run/docker.sock' updated-image 21ab84251c7b
FROM lukapeschke/dfa:latest
/bin/sh -c
/bin/sh -c
apk add --update python3 wget \
&& wget -O - --no-check-certificate https://bootstrap.pypa.io/get-pip.py | python3 \
&& apk del wget \
&& pip3 install -U docker-py \
&& yes | pip3 uninstall pip
/bin/sh -c
/bin/sh -c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the code 😄 It should fixed in the following commits.
f54ac7f
to
83c9b7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed a missing RUN
, script output looks good now 🙂 Thanks a lot for your contribution!
No description provided.