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
Push alpine stuff upstream into an apk package #454
Comments
I have no idea how to effectively contribute to apk, but this quick attempt is more trouble than I really have time for now |
Also explored this in https://gitlab.alpinelinux.org/alpine/aports/merge_requests/4846 to use a similar update script to provide all current python versions. This could provide a way to focus efforts on the alpine python builds into the details of the |
For practical purposes, I solved my immediate use-case for a gitlab-CI base image using |
Alpine's package repos only contain the latest version. python/3.6/alpine3.11/Dockerfile Line 29 in 905c16b
with these options python/3.6/alpine3.11/Dockerfile Lines 70 to 79 in 905c16b
You can install it from source as our Dockerfile does or maybe try the
What about python:3.6-alpine3.11? $ docker pull python:3.6-alpine3.11
3.6-alpine3.11: Pulling from library/python
Digest: sha256:565c566c317c077fdc520a5dcee8374339bda70ddd9f2dfad9499cde45fb5831
Status: Downloaded newer image for python:3.6-alpine3.11
docker.io/library/python:3.6-alpine3.11
$ docker run -it --rm python:3.6-alpine3.11 ash
/ # python --version
Python 3.6.10
/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/" |
If the goal is simply to have the Docker client in an Alpine-based Python image, I think going the other way is probably easier -- the Docker client itself is just a static binary, so something like the following should work reasonably well: FROM python:3.6-alpine3.11
COPY --from=docker:19.03 /usr/local/bin/docker /usr/local/bin/
RUN docker --version $ docker build --pull .
Sending build context to Docker daemon 2.048kB
Step 1/3 : FROM python:3.6-alpine3.11
3.6-alpine3.11: Pulling from library/python
Digest: sha256:bfd26729964b518c651270064dd54fe122ce0deeb69c43dbefb3176a8bdbb18f
Status: Image is up to date for python:3.6-alpine3.11
---> b2bb7dfc2c59
Step 2/3 : COPY --from=docker:19.03 /usr/local/bin/docker /usr/local/bin/
19.03: Pulling from library/docker
Digest: sha256:9170b902404a630a982a2a6473442d3e2cc2342b66345f7a9cf148f8affcf5d3
Status: Image is up to date for docker:19.03
---> Using cache
---> dd163e21c144
Step 3/3 : RUN docker --version
---> Running in d26884bf28d8
Docker version 19.03.13, build 4484c46
Removing intermediate container d26884bf28d8
---> e88b81e2f766
Successfully built e88b81e2f766 (Closing, since the original ask is better tracked in https://gitlab.alpinelinux.org/alpine/aports/issues/11265, and isn't something we have any real interest or bandwidth in contributing to.) |
Is it possible to push all of this into an alpine package:
So the Dockerfile can simply do:
The current alpine package is not working for python 3.6, e.g.
use case
To use docker-in-docker to run tests that need to run docker containers in gitlab, the gitlab-CI needs to use
docker:19.03.6
, which is based onalpine:3.11
. Butalpine:3.11
has no python package for 3.6 (please point to one if it exists), so it's not possible to usedocker:19.03.6
with python 3.6 (AFAICT), without the project having to provide it's own docker image/build and run all it's tests inside a custom image for the project. Then anything inside that container that needs to run docker needs the same thing - it can't do docker-in-docker-in-docker - it's nuts. That's extra overhead that the project could avoid if apk can install any python 3.x and maybe this project has all the clues about how to contribute back to apk to use any python 3.x package.The text was updated successfully, but these errors were encountered: