CAPItan / Dockerfile
ngoctuanai's picture
Update Dockerfile
a11686a
raw
history blame
1.28 kB
# Start with the Debian Bullseye Slim image
FROM debian:bullseye-slim
# Update package files and install Curl
RUN apt-get update && apt-get install -y curl
# Download the latest version of Ninja from GitHub
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/gngpp/ninja/releases/latest)) \
&& base_url="https://github.com/gngpp/ninja/releases/expanded_assets/$version" \
# Lấy URL của bản phân phối dựa trên CPU x86_64 và musl libc.
&& latest_url=https://github.com/$(curl -sL $base_url | grep -oP 'href=".*x86_64.*musl\.tar\.gz(?=")' | sed 's/href="//') \
# Tải tệp tar.gz và giải nén nó
&& curl -Lo ninja.tar.gz $latest_url \
&& tar -xzf ninja.tar.gz
# Set the Chinese language environment and do not interact with APT
ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive LANG=en-US.UTF-8 LANGUAGE=en-US.UTF-8 LC_ALL=C
# Copy the main `ninja` file to /bin so it can be run from anywhere
RUN cp ninja /bin/ninja
# Create necessary folders and set access rights
RUN mkdir /.gpt3 && chmod 777 /.gpt3
RUN mkdir /.gpt4 && chmod 777 /.gpt4
RUN mkdir /.auth && chmod 777 /.auth
RUN mkdir /.platform && chmod 777 /.platform
# By default when running an image, it will run ninja
CMD ["/bin/ninja","run"]