#How to install a linux package inside the docker container

5 messages · Page 1 of 1 (latest)

jolly rivet
#

Trying to install a mod on my minecraft server to handle backups. The mod needs git and git-lfs to work.
I'm using the Java 21|ghcr.io/pterodactyl/yolks:java_21 docker image, but the container seems to be set to read-only so I can't get apt-get to work even with docker exec --privileged -u 0.
How can I get git-lfs installed?

jolly rivet
#

I created a custom dockerfile with git-lfs included which solved my problem

warm otter
jolly rivet
#

here's the dockerfile I made
`FROM ubuntu:20.04 AS builder

RUN apt-get update &&
apt-get install -y git-lfs &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

FROM ghcr.io/pterodactyl/yolks:java_21

Copy the git-lfs binary from the builder stage

COPY --from=builder /usr/bin/git-lfs /usr/bin/git-lfs

Ensure git-lfs is installed correctly

RUN git lfs install`