mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
Move server back to index.js
This commit is contained in:
1 parent
de637f3cf6
commit
45a0aa6249
5 files changed
+38
-38
No files matched your search
+4
-2
@@ -16,7 +16,9 @@ const containerOptions = {
|
||||
export async function getOrCreateContainer(name) {
|
||||
try {
|
||||
const container = engine.getContainer(name)
|
||||
await container.inspect()
|
||||
if (!(await container.inspect()).State.Running) {
|
||||
await container.start()
|
||||
}
|
||||
return container
|
||||
} catch (error) {
|
||||
const container = await engine.createContainer({
|
||||
@@ -29,7 +31,7 @@ export async function getOrCreateContainer(name) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function attachContainer(container) {
|
||||
export function attachContainer(container) {
|
||||
// Create an exec instance with bash shell
|
||||
return container.attach({
|
||||
stream: true,
|
||||
|
||||
Reference in new issue
Block a user