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

Rework python3 on debian12 #1415

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Rework python3 on debian12 #1415

merged 1 commit into from
Oct 10, 2023

Conversation

loosebazooka
Copy link
Member

  • removes shell
  • removes support for ctypes
  • brings python3 out of experimental for debian12

@loosebazooka loosebazooka force-pushed the make-python3-pure-again branch 4 times, most recently from 0c9bba6 to d8fcce5 Compare September 29, 2023 18:35
@loosebazooka loosebazooka force-pushed the make-python3-pure-again branch from d8fcce5 to 9f73d66 Compare September 29, 2023 18:42
@loosebazooka loosebazooka marked this pull request as ready for review October 4, 2023 14:05
@loosebazooka
Copy link
Member Author

@evanj @lathama would you have a minute to test these images before merging this pr?

add oci_tarball rule

--- a/python3/BUILD
+++ b/python3/BUILD
@@ -124,3 +124,9 @@ DISTRO_VERSION = {
     for arch in ARCHITECTURES
     for distro in DISTROS
 ]
+
+oci_tarball(                                                                                                         
+  name = "python3_tarball",                                                                                          
+  image = ":python3_root_amd64_debian12",                                                                            
+  repotags = ["python3_distroless:1"],                                                                               
+) 

build and load into docker daemon

$ bazel build //python3:python3_tarball
...
$ docker load < bazel-bin/python3/python3_tarball/tarball.tar

then run or use in a docker build (although I'm mostly interested if this runs your applications)

$ docker run python3_distroless:1 \-\-help

- removes shell
- removes support for ctypes
- brings python3 out of experimental for debian12

Signed-off-by: Appu Goundan <[email protected]>
@loosebazooka loosebazooka force-pushed the make-python3-pure-again branch from 9f73d66 to 9e62fd2 Compare October 5, 2023 13:34
@evanj
Copy link
Contributor

evanj commented Oct 8, 2023

I just tried it with a container I have that uses gunicorn and it appears to work for me. Thanks!

@loosebazooka loosebazooka merged commit b203cec into main Oct 10, 2023
11 checks passed
@loosebazooka loosebazooka deleted the make-python3-pure-again branch October 10, 2023 16:46
@waaffles
Copy link

waaffles commented Nov 13, 2023

Sorry to rehash an older PR that's already been merged but can we update the docs somewhere around how python3:debug doesn't actually include a shell? As of now, isn't the allure of debug the fact that you get a shell to be able to debug? Or maybe I misinterpreted.
https://github.com/GoogleContainerTools/distroless#debug-images
Apologies if I misinterpreted and the shell is there for executing CMD but not for any commands prior to within the dockerfile itself?

@loosebazooka
Copy link
Member Author

I believe you can execute commands with the shell, what are you trying to do exactly? The path to shell is slightly different. It's /busybox/sh ?

@waaffles
Copy link

Ah, okay. So the debug option doesn't allow sh to be used within the dockerfile itself and instead sets the entrypoint to be /busybox/sh? I was also trying to run some commands from within the dockerifle as I needed to use mkdir and ln. Is it only sh that's offered or are other binaries in place as well? I wasn't sure where to check for the full list of which utilities we get with the debug option

@loosebazooka
Copy link
Member Author

busybox should have all those utilities on the path: https://busybox.net/downloads/BusyBox.html has the full list.

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

Successfully merging this pull request may close these issues.

4 participants