Adds support for a VSCode container
This commit is contained in:
@@ -59,6 +59,12 @@
|
||||
<label for="name">Easy name: </label><input id='name'>
|
||||
<br>
|
||||
<button id='createImage'>Create</button>
|
||||
<h3>List of official images</h3>
|
||||
<ul>
|
||||
<li>Simple Desktop - lukasdotcom/docker-desktop</li>
|
||||
<li>Firefox - lukasdotcom/firefox</li>
|
||||
<li>VScode - lscr.io/linuxserver/code-server</li>
|
||||
</ul>
|
||||
<h3>How to create Image?</h3>
|
||||
<p>All you have to do to create a valid image for this is have a docker image that accepts an enviromental variable called VNC_PASSWD that is the password for the web interface and that exposes port 80 as a way to access the web interface. Then just publish it on dockerhub and pull it onto the device you are running this on.</p>
|
||||
<?php
|
||||
|
||||
@@ -367,7 +367,10 @@ Deny from all""")
|
||||
writeLog(f"Container with id of {id} was stopped", 24)
|
||||
elif x[1] == "starting": # Will start all containers that are neccessary
|
||||
password = x[3]
|
||||
newID = dockerClient.containers.run(x[2], detach=True, ports={'80/tcp':x[5]}, remove=True, environment=[f"VNC_PASSWD={password}"]).attrs["Id"]
|
||||
if x[2] == "lscr.io/linuxserver/code-server":
|
||||
newID = dockerClient.containers.run(x[2], detach=True, ports={'8443/tcp':x[5]}, remove=True, environment=["PUID=1000", "GUID=1000", "TZ=America/Detroit", f"PASSWORD={password}", f"SUDO_PASSWORD={password}", "DEFAULT_WORKSPACE=/config/workspace"]).attrs["Id"]
|
||||
else:
|
||||
newID = dockerClient.containers.run(x[2], detach=True, ports={'80/tcp':x[5]}, remove=True, environment=[f"VNC_PASSWD={password}"]).attrs["Id"]
|
||||
database.command(f"UPDATE docker SET action='started', id='{newID}' WHERE ID='{id}'")
|
||||
writeLog(f"Container with id of {id} which changed to {newID} was started", 23)
|
||||
elif x[1] == "stopping": # Stops all containers that need to be stopped.
|
||||
|
||||
Reference in New Issue
Block a user