fix: install apt utils and certificates

This commit is contained in:
Amin Yahyaabadi 2022-01-19 16:00:12 -08:00
parent 36cac945b8
commit de8de27990
6 changed files with 24 additions and 10 deletions

View File

@ -172,8 +172,7 @@ FROM debian:bullseye
# add setup_cpp
WORKDIR "/"
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y --no-install-recommends ca-certificates wget unzip
RUN apt-get install -y --no-install-recommends wget
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.5.5/setup_cpp_linux"
RUN chmod +x ./setup_cpp_linux

View File

@ -4,8 +4,7 @@ FROM debian:bullseye
# add setup_cpp
WORKDIR "/"
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y --no-install-recommends ca-certificates wget unzip
RUN apt-get install -y --no-install-recommends wget
RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.5.5/setup_cpp_linux"
RUN chmod +x ./setup_cpp_linux

View File

@ -5,10 +5,6 @@ FROM node:16-slim
ADD "./dist/" "/"
WORKDIR "/"
# install unzip for the slim image (a standard debian already has it)
RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends unzip
# run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true --vcpkg true

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import { InstallationInfo } from "./setupBin"
import { execaSudo } from "../env/sudo"
let didUpdate: boolean = false
let didInit: boolean = false
/** A function that installs a package using apt */
export async function setupAptPack(
@ -12,6 +13,25 @@ export async function setupAptPack(
): Promise<InstallationInfo> {
const apt = "apt-get"
process.env.DEBIAN_FRONTEND = "noninteractive"
if (!didInit) {
// install apt utils and certificates (usually missing from docker containers)
// set time - zone
// TZ = Canada / Pacific
// ln - snf / usr / share / zoneinfo / $TZ / etc / localtime && echo $TZ > /etc/timezone
await execaSudo(apt, [
"install",
"--fix-broken",
"-y",
"software-properties-common",
"apt-utils",
"ca-certificates",
"gnupg",
])
didInit = true
}
if (Array.isArray(repositories)) {
for (const repo of repositories) {
// eslint-disable-next-line no-await-in-loop