Spaces:
Paused
Paused
xukc
commited on
Commit
·
cce47b9
1
Parent(s):
9f31b8e
[fix]Dockerfile2
Browse files- Dockerfile +21 -5
Dockerfile
CHANGED
@@ -1,17 +1,33 @@
|
|
1 |
# Use an official Ubuntu runtime as a parent image
|
2 |
FROM ubuntu:latest
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Set the working directory to /app
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy the source code into the container
|
8 |
COPY . .
|
9 |
|
10 |
-
# Install necessary dependencies
|
11 |
-
RUN sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu\//http:\/\/mirrors.aliyun.com\/ubuntu\//g' /etc/apt/sources.list
|
12 |
-
RUN apt-get update
|
13 |
-
RUN apt-get update && apt-get install -y g++ libhv-dev
|
14 |
-
|
15 |
# Compile the C++ program
|
16 |
RUN g++ -std=c++14 -g -o proxyServer hv_utils.cpp tcp_inbound.cpp main.cpp -I include -lhv
|
17 |
|
|
|
1 |
# Use an official Ubuntu runtime as a parent image
|
2 |
FROM ubuntu:latest
|
3 |
|
4 |
+
# Use Aliyun mirrors for apt-get
|
5 |
+
RUN sed -i 's/http:\/\/deb.debian.org\/debian\//http:\/\/mirrors.aliyun.com\/debian\//g' /etc/apt/sources.list
|
6 |
+
|
7 |
+
# Update the package lists
|
8 |
+
RUN apt-get update
|
9 |
+
|
10 |
+
# Install g++ and necessary build tools
|
11 |
+
RUN apt-get install -y g++ make cmake
|
12 |
+
|
13 |
+
# Download and build libuv from source
|
14 |
+
RUN apt-get install -y git
|
15 |
+
RUN git clone https://github.com/libuv/libuv.git /usr/src/libuv
|
16 |
+
WORKDIR /usr/src/libuv
|
17 |
+
RUN sh autogen.sh
|
18 |
+
RUN ./configure
|
19 |
+
RUN make
|
20 |
+
RUN make install
|
21 |
+
|
22 |
+
# Add the libuv library path
|
23 |
+
RUN ldconfig
|
24 |
+
|
25 |
# Set the working directory to /app
|
26 |
WORKDIR /app
|
27 |
|
28 |
# Copy the source code into the container
|
29 |
COPY . .
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
# Compile the C++ program
|
32 |
RUN g++ -std=c++14 -g -o proxyServer hv_utils.cpp tcp_inbound.cpp main.cpp -I include -lhv
|
33 |
|