Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix apt-get glibc error #984

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/apt-ffmpeg/nixpacks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[phases.setup]
aptPkgs = [
"...",
"ffmpeg",
"imagemagick",
"ghostscript",
"gsfonts",
"fonts-droid-fallback",
"fonts-noto-mono",
"fonts-urw-base35",
]

[start]
cmd = "ffmpeg 2>&1"
2 changes: 1 addition & 1 deletion src/nixpacks/builder/docker/dockerfile_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl DockerfileGenerator for BuildPlan {
String::new()
} else {
format!(
"RUN apt-get update && apt-get install -y --no-install-recommends {}",
"RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends {}",
apt_pkgs.join(" ")
)
};
Expand Down
7 changes: 7 additions & 0 deletions tests/docker_run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,3 +1166,10 @@ async fn test_nested_directory() {
let name = simple_build("./examples/nested").await;
assert!(run_image(&name, None).await.contains("Nested directories!"));
}

#[tokio::test]
async fn test_ffmpeg() {
let name = simple_build("./examples/apt-ffmpeg").await;
let output = run_image(&name, None).await;
assert!(output.contains("ffmpeg version"));
}
25 changes: 25 additions & 0 deletions tests/snapshots/generate_plan_tests__apt_ffmpeg.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
source: tests/generate_plan_tests.rs
expression: plan
---
{
"providers": [],
"buildImage": "[build_image]",
"phases": {
"setup": {
"name": "setup",
"aptPkgs": [
"ffmpeg",
"imagemagick",
"ghostscript",
"gsfonts",
"fonts-droid-fallback",
"fonts-noto-mono",
"fonts-urw-base35"
]
}
},
"start": {
"cmd": "ffmpeg 2>&1"
}
}
Loading