alpine sucks sometimes
All checks were successful
Build and deploy / deploy (push) Successful in 1m23s

This commit is contained in:
2025-09-05 00:39:53 +01:00
parent eb23299181
commit 32f53eb27e
3 changed files with 9 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
# Use the official Node.js image as the base image
FROM node:24-alpine
FROM node:24-trixie-slim
# Set the working directory inside the container
WORKDIR /usr/src/app

View File

@@ -9,7 +9,7 @@ function DockerRow({
}: {
containerInfo: dockerRouterType["list"][number];
}) {
const { data: latest, isError, isLoading } = api.docker.latest.useQuery({ id: containerInfo.container.id });
const { data: latest, isError, isLoading } = api.docker.latest.useQuery({ id: containerInfo.container.id }, { refetchOnMount: false, refetchOnWindowFocus: false, refetchOnReconnect: false });
const outdated = containerInfo.image.current.hash !== latest?.latest.hash;
let latestFragment: JSX.Element | null = null;
@@ -52,7 +52,7 @@ function DockerRow({
}
export function DockerTable() {
const { data: list, isLoading: listLoading } = api.docker.list.useQuery();
const { data: list, isLoading: listLoading } = api.docker.list.useQuery(undefined, { refetchOnMount: false, refetchOnWindowFocus: false, refetchOnReconnect: false });
return (
<div className="overflow-x-auto rounded-md border border-base-content/15 bg-base-100">
{!listLoading ? (

View File

@@ -14,6 +14,7 @@ export const dockerRouter = createTRPCRouter({
const container = containers.find((container) => container.Id === input.id);
if (!container) {
console.error(`Container with id ${input.id} not found`);
throw new TRPCError({
code: "NOT_FOUND",
message: `Container with id ${input.id} not found`,
@@ -27,6 +28,7 @@ export const dockerRouter = createTRPCRouter({
latest: await getLatest(imageData.name, imageData.tag),
};
} catch (ex) {
console.error(ex);
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: (ex as Error).message,
@@ -159,9 +161,10 @@ function isSemver(tag: string): boolean {
}
async function getHash(image: string) {
const latestImage = await $`bin/regctl image digest ${image}`.text();
const latestImage = await $`./bin/regctl image digest ${image}`.text();
const hash = latestImage.split(":")?.[1]?.substring(0, 12);
if (!hash) {
console.error(`Hash not found: ${latestImage}`);
throw new Error("Hash not found", {
cause: {
imageDigest: latestImage,
@@ -189,8 +192,8 @@ async function getLatest(image: string, tag?: string): Promise<{ hash: string; t
}
async function getSemverTag(image: string): Promise<{ hash: string; tag?: string }> {
const allTags = await $`bin/regctl tag ls --exclude 'version.*' --exclude 'unstable.*' --exclude '.*rc.*' --exclude 'lib.*' --exclude 'release.*' --exclude 'arm.*
' --exclude 'amd.*' ${image}`.text();
const allTags =
await $`./bin/regctl tag ls --exclude 'version.*' --exclude 'unstable.*' --exclude '.*rc.*' --exclude 'lib.*' --exclude 'release.*' --exclude 'arm.*' --exclude 'amd.*' ${image}`.text();
const semverTags = allTags.split("\n").filter((tag) => isSemver(tag));
const newestTag = semver.rsort(semverTags)[0];