Skip to content

Commit

Permalink
Fix python & java in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
TheApplePieGod committed Jan 4, 2025
1 parent e48ac32 commit 1bd1556
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions saturn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Build go app
FROM golang:1.23.4-bookworm AS go

ENV BUILD_HOME /build
Expand All @@ -9,20 +10,22 @@ RUN go mod download
COPY . .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /saturn -ldflags="-s -w" ./cmd/saturn/main.go

# Link intermediate container for python
FROM python:3.12-slim-bookworm as python

FROM openjdk:21-jdk-slim-bookworm

# Setup
RUN echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list && \
apt-get update

# Install JDK8. The base image provides JDK21, but we still need JDK8 to
# run matches with java8
#RUN apt-get update && \
# apt-get install -y openjdk-8-jdk

# Install python
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt install -y python3.12
RUN apt-get install -y -t unstable openjdk-8-jdk

# Copy python from intermediate container
COPY --from=python /usr/local/bin/python3.12 /usr/local/bin/python3.12
COPY --from=python /usr/local/lib/libpython3.* /usr/local/lib

ENV APP_HOME /app
WORKDIR $APP_HOME
Expand Down

0 comments on commit 1bd1556

Please sign in to comment.