Skip to content

Commit b46eaf8

Browse files
authored
Create README.md
1 parent 019f823 commit b46eaf8

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Compiler-Explorer-Docker
2+
3+
Host your own Compiler Explorer instance in docker container!
4+
5+
## Requirements
6+
7+
- [Git](https://git-scm.com/download/win)
8+
- [Docker](https://www.docker.com/products/docker-desktop/)
9+
- [Enabled Hyper-V Windows feature](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v#enable-hyper-v-using-powershell)
10+
11+
> [!NOTE]
12+
> [Hyper-V Windows feature](<https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/Install-Hyper-V?pivots=windows#enable-hyper-v-using-powershell>) _is not_ really required if you use process isolation for both the image build & runtime.
13+
14+
## How to
15+
16+
> [!IMPORTANT]
17+
> If using Docker Desktop - first make sure you have switched to `Containers for Windows`. If you are CLI user and have client & daemon headless, then use appropriate windows build context.
18+
19+
![Containers for Windows](https://user-images.githubusercontent.com/65064509/152947300-affca592-35a7-4e4c-a7fc-2055ce1ba528.png)
20+
21+
### Build and run
22+
23+
Clone the repository
24+
25+
```powershell
26+
git clone https://github.com/Devsh-Graphics-Programming/Compiler-Explorer-Docker.git
27+
```
28+
29+
enter the cloned directory, build the image
30+
31+
```powershell
32+
docker build --isolation "process" -t godbolt/nano .
33+
```
34+
35+
> [!TIP]
36+
> I highly recommend to build the image without virtualization (process isolation) to use all host resources, HyperV isolation will assign 1/2 CPUs + 1GB of RAM by default hence the result could be < 10x slower build _without assigning cpu resources by hand_. If you get an error and can't use process isolation it's because your host kernel version is too low - update your OS or switch to HyperV (skip `--process "isolation"` flag).
37+
38+
> [!TIP]
39+
> The image is built with default set of options, there are a few you can override (eg. NodeJS version, remote & sha of CE). See [Dockerfile](<https://github.com/Devsh-Graphics-Programming/Compiler-Explorer-Docker/blob/master/Dockerfile>) code for more details.
40+
41+
run the container
42+
43+
```powershell
44+
docker run -p 80:10240 -it godbolt/nano
45+
```
46+
47+
and open your browser with **http://localhost**.
48+
49+
> [!IMPORTANT]
50+
> You should use produced image as base to provide your own compilers (installation binaries) & configuration files for CE to use them. By default we run it without any compilers.

0 commit comments

Comments
 (0)