Skip to content

Commit

Permalink
Update Python 3 in Docker image to 3.10 (#100)
Browse files Browse the repository at this point in the history
Otherwise `apt` will install some other bs LMAO 

---------

Co-authored-by: Natsu Kagami <[email protected]>
  • Loading branch information
minhnhatnoe and natsukagami authored Jun 3, 2023
1 parent f93591d commit 3159665
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
# Stage -1: Update apt-get
FROM ubuntu:jammy AS base-ubuntu

# Mount apt's cache folders to cache install but maintain
# reproducibility on local machines. More details at:
# https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/reference.md#run---mounttypecache

# Set sharing=locked to avoid race condition with between stages.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get upgrade -y

# Stage 0: Compile isolate
FROM ubuntu:jammy AS isolate
FROM base-ubuntu AS isolate

RUN apt-get update && apt-get install -y libcap-dev gcc git make
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y libcap-dev gcc git make

WORKDIR /isolate

Expand Down Expand Up @@ -37,11 +51,14 @@ RUN scripts/install_tools.sh
RUN go generate && go build -tags production -o kjudge cmd/kjudge/main.go

# Stage 3: Create awesome output image
FROM ubuntu:jammy
FROM base-ubuntu

RUN apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="Asia/Ho_Chi_Minh" apt-get install -y \
build-essential openjdk-11-jdk-headless fp-compiler python3.6 cgroup-lite python2.7 rustc golang libcap-dev # Compilers \
openssl # For HTTPS support
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="Asia/Ho_Chi_Minh" apt-get install -y \
build-essential openjdk-11-jdk-headless fp-compiler cgroup-lite \
python3.10 python2.7 rustc golang libcap-dev \
openssl

COPY --from=isolate /isolate/ /isolate

Expand All @@ -59,4 +76,3 @@ EXPOSE 80 443

WORKDIR /
ENTRYPOINT ["scripts/start_container.sh"]

0 comments on commit 3159665

Please sign in to comment.