Skip to content

Commit b1d083d

Browse files
committed
Add python
1 parent 26cf869 commit b1d083d

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

build-langs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ for lang in *; do
1717

1818
# Remove the crap we gained from running the container, this is hacky.
1919
rm -r $lang/rootfs/{.dockerenv,dev,etc,proc,sys}
20+
21+
# Python needs UIDs to actually resolve, madness!
22+
mkdir $lang/rootfs/etc
23+
echo nobody:x:99:99:nobody:/:/bin/false > $lang/rootfs/etc/passwd
2024
done

code-golf.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ func runCode(lang, code string) string {
244244
"/usr/share/perl6/runtime/perl6.moarvm",
245245
"-",
246246
}
247+
case "python":
248+
cmd.Args = []string{"/usr/bin/python3.6", "python"}
247249
default:
248250
cmd.Args = []string{"/usr/bin/" + lang, lang}
249251
}

containers/python/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM alpine:edge
2+
3+
RUN apk add --no-cache curl gcc linux-headers make musl-dev zlib-dev
4+
5+
RUN curl https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz \
6+
| tar xJf -
7+
8+
RUN cd Python-3.6.1 \
9+
&& ./configure --prefix=/usr \
10+
&& make install
11+
12+
FROM scratch
13+
14+
COPY --from=0 /lib/ld-musl-x86_64.so.1 /lib/
15+
COPY --from=0 /usr/bin/python3.6 /usr/bin/
16+
COPY --from=0 /usr/lib/python3.6 /usr/lib/python3.6
17+
18+
ENTRYPOINT ["/usr/bin/python3.6"]

0 commit comments

Comments
 (0)