Commit
·
76fbabe
1
Parent(s):
16ce4f2
Update Dockerfile
Browse files- Dockerfile +12 -2
Dockerfile
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
|
|
| 1 |
FROM debian:bullseye-slim
|
|
|
|
|
|
|
| 2 |
RUN apt-get update && apt-get install -y curl
|
| 3 |
|
|
|
|
| 4 |
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/gngpp/ninja/releases/latest)) \
|
| 5 |
&& base_url="https://github.com/gngpp/ninja/releases/expanded_assets/$version" \
|
|
|
|
| 6 |
&& latest_url=https://github.com/$(curl -sL $base_url | grep -oP 'href=".*x86_64.*musl\.tar\.gz(?=")' | sed 's/href="//') \
|
|
|
|
| 7 |
&& curl -Lo ninja.tar.gz $latest_url \
|
| 8 |
&& tar -xzf ninja.tar.gz
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
RUN cp ninja /bin/ninja
|
|
|
|
|
|
|
| 14 |
RUN mkdir /.gpt3 && chmod 777 /.gpt3
|
| 15 |
RUN mkdir /.gpt4 && chmod 777 /.gpt4
|
| 16 |
RUN mkdir /.auth && chmod 777 /.auth
|
| 17 |
RUN mkdir /.platform && chmod 777 /.platform
|
| 18 |
|
|
|
|
| 19 |
CMD ["/bin/ninja","run"]
|
|
|
|
| 1 |
+
# Start with the Debian Bullseye Slim image
|
| 2 |
FROM debian:bullseye-slim
|
| 3 |
+
|
| 4 |
+
# Update package files and install Curl
|
| 5 |
RUN apt-get update && apt-get install -y curl
|
| 6 |
|
| 7 |
+
# Download the latest version of Ninja from GitHub
|
| 8 |
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/gngpp/ninja/releases/latest)) \
|
| 9 |
&& base_url="https://github.com/gngpp/ninja/releases/expanded_assets/$version" \
|
| 10 |
+
# Lấy URL của bản phân phối dựa trên CPU x86_64 và musl libc.
|
| 11 |
&& latest_url=https://github.com/$(curl -sL $base_url | grep -oP 'href=".*x86_64.*musl\.tar\.gz(?=")' | sed 's/href="//') \
|
| 12 |
+
# Tải tệp tar.gz và giải nén nó
|
| 13 |
&& curl -Lo ninja.tar.gz $latest_url \
|
| 14 |
&& tar -xzf ninja.tar.gz
|
| 15 |
|
| 16 |
+
# Set the Chinese language environment and do not interact with APT
|
| 17 |
+
ENV LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive LANG=en-US.UTF-8 LANGUAGE=en-US.UTF-8 LC_ALL=C
|
| 18 |
|
| 19 |
+
# Copy the main `ninja` file to /bin so it can be run from anywhere
|
|
|
|
| 20 |
RUN cp ninja /bin/ninja
|
| 21 |
+
|
| 22 |
+
# Create necessary folders and set access rights
|
| 23 |
RUN mkdir /.gpt3 && chmod 777 /.gpt3
|
| 24 |
RUN mkdir /.gpt4 && chmod 777 /.gpt4
|
| 25 |
RUN mkdir /.auth && chmod 777 /.auth
|
| 26 |
RUN mkdir /.platform && chmod 777 /.platform
|
| 27 |
|
| 28 |
+
# By default when running an image, it will run ninja
|
| 29 |
CMD ["/bin/ninja","run"]
|