Misc fixes for containerization

This commit is contained in:
Radon Rosborough 2021-03-21 14:36:44 -07:00
parent 69f1c2ed58
commit 224f8f7d9d
5 changed files with 13 additions and 13 deletions

View File

@ -15,7 +15,7 @@ const allSessions = new Set();
export class Session {
get homedir() {
return `/tmp/riju/${this.uuid}`;
return "/home/riju/src";
}
get config() {

View File

@ -3,7 +3,10 @@ FROM ubuntu:rolling
COPY docker/base/install.bash /tmp/
RUN /tmp/install.bash
WORKDIR /src
RUN useradd -p '!' -m -l -s /usr/bin/bash riju
RUN runuser -u riju -- mkdir /home/riju/src
WORKDIR /home/riju/src
COPY docker/shared/my_init /usr/local/sbin/
ENTRYPOINT ["/usr/local/sbin/my_init", "--quiet", "--"]
CMD ["bash"]

View File

@ -5,10 +5,4 @@ ARG LANG
COPY docker/lang/install.bash /tmp/
RUN /tmp/install.bash
ENTRYPOINT ["/usr/local/sbin/my_init", "--quiet", "--"]
RUN rm /usr/local/sbin/pid1.bash
RUN useradd -p '!' -m -l -s /usr/bin/bash riju
WORKDIR /home/riju/src
USER riju
CMD ["bash"]

View File

@ -28,9 +28,11 @@ if dpkg-deb -f "riju-lang-${LANG}.deb" -f Depends | grep .; then
apt-get update
fi
for file in ./riju-shared-*.deb; do
apt-get install -y "${file}"
done
if compgen -G "./riju-shared-*.deb"; then
for file in ./riju-shared-*.deb; do
apt-get install -y "${file}"
done
fi
apt-get install -y "./riju-lang-${LANG}.deb"

View File

@ -1,5 +1,6 @@
import { promises as fs } from "fs";
import http from "http";
import url from "url";
import { Command } from "commander";
import express from "express";
@ -24,7 +25,7 @@ async function main() {
program.requiredOption("--lang <id>", "language ID");
program.option("--debug", "interactive debugging");
program.parse(process.argv);
const { lang, debug } = program;
const { lang, debug } = program.opts();
const hash = await hashDockerfile(
"lang",
{
@ -35,7 +36,7 @@ async function main() {
langHash: await getDebHash(`build/lang/${lang}/riju-lang-${lang}.deb`),
sharedHashes: (
await Promise.all(
getSharedDepsForLangConfig(await readLangConfig(lang)).map(
(await getSharedDepsForLangConfig(await readLangConfig(lang))).map(
async (name) =>
await getDebHash(`build/shared/${name}/riju-shared-${name}.deb`)
)