Skip to content

Commit

Permalink
feat: Update Dockerfile to use latest version of debian-ssh-12.6 imag…
Browse files Browse the repository at this point in the history
…e and add dumb-init for process management
  • Loading branch information
cbluebird committed Sep 13, 2024
1 parent 38d42f4 commit a264e6e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Language/java/openjdk17/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/labring-actions/devbox/debian-ssh-12.6:d8b67a
FROM ghcr.io/labring-actions/devbox/debian-ssh-12.6:a9c28d

RUN cd /home/sealos/project && \
rm -rf ./*
Expand Down
27 changes: 23 additions & 4 deletions Language/java/project/HelloWorld.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
// Your First Program
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpExchange;

class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;

public class HelloWorld {
public static void main(String[] args) throws IOException {
HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
server.createContext("/", new MyHandler());
server.setExecutor(null);
server.start();
}

static class MyHandler implements HttpHandler {
public void handle(HttpExchange exchange) throws IOException {
String response = "Hello, World!";
exchange.sendResponseHeaders(200, response.length());
OutputStream os = exchange.getResponseBody();
os.write(response.getBytes());
os.close();
}
}
}
Empty file modified Language/java/project/entrypoint.sh
100644 → 100755
Empty file.

0 comments on commit a264e6e

Please sign in to comment.