App source + Nix packages + Docker = Image

Overview

Nixpacks

CI

App source + Nix packages + Docker = Image

Nixpacks takes a source directory and produces an OCI compliant image that can be deployed anywhere. The project was started by the Railway team as an alternative to Buildpacks and attempts to address a lot of the shortcomings and issues that occurred when deploying thousands of user apps to the Railway platform. The biggest change is that system and language dependencies are pulled from the Nix ecosystem, which provides a bunch of benifits.

You can follow along with the roadmap in the GitHub project.

Core Ideas

  • Intutive defaults: In most cases, building and deploying and app with nixpacks should just work with no configuration needed.
  • ⚙️ Customization where necessary: Every part of the pipeline should be customizable. These include the Nix packages to add to the environment and build/start commands.
  • 🚀 Easily extendible: New providers (languages) should be able to be easily added to nixpacks with minimal knowledge of Nix and Docker.

How Nix is used

Nix packages are used for OS and language level dependencies (e.g. nodejs and ffmpeg). These packages are built and loaded into the environment where we then use these dependencies to install, build, and run the app (e.g. npm install, cargo build, etc.).

How Docker is used

At the moment nixpacks generates a Dockerfile based on all information available. To create an image this is then built with docker build. However, this may change so providers should not need to know about the underlying Docker implementation.

Docs

This project is not yet distributed anywhere and must be built with Rust.

  1. Checkout this repo git clone https://github.com/railwayapp/nixpacks.git
  2. Build the source cargo build
  3. Run the tests cargo test

There are two main commands

plan

Generates a build plan and outputs to stdout.

cargo run -- plan $APP_SRC

image

View the help with cargo run -- plan --help

build

Creates a runnable image with Docker

cargo run -- build $APP_SRC --name $NAME

image

View the help with cargo run -- build --help

How this works

Nixpacks works in two phases

Plan

Analyze the app source directory and generates a reproducible build plan. This plan can be saved (in JSON format) an re-used at a later date to build the image in the exact same way every time.

Language providers are matched against the app source directory and suggest Nix packages, an install command, build command, and start command. All of these can be overwritten by the user.

Build

The build phase takes the build plan and creates an OCI compliant image (with Docker) that can be deployed and run anywhere. This happens in the following steps

  1. Create build plan
  2. Copy app source to temp directory
  3. Use the Nix packages in the build plan and generate an environment.nix file
  4. Use the install, build, and start commands and generate a Dockerfile
  5. Done!

Overall the process is fairy simple.

Language providers

At the moment nixpacks supports the following languages out of the box

Contributing

Contributions are welcome with the big caveat that this is a very early stage project and the implementation details and API will most likely change between now and a stable release. For more details on how to contribute, please see the Contributing guidelines.

Comments
  • Problems with zlib in a haskell project

    Problems with zlib in a haskell project

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Describe the bug

    I'm trying to deploy a fairly straightforward haskell (servant project).

    I've specified zlib and zlib.dev in --pkgs but I'm still running into:

    #12 119.8
    #12 119.8 --  While building package zlib-0.6.2.1 (scroll up to its section to see the error) using:
     
    #12 119.8       /root/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 configure --with-ghc=/root/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin/ghc-8.6.5 --with-ghc-pkg=/root/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin/ghc-pkg-8.6.5 --user --package-db=clear --package-db=global --package-db=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/pkgdb --libdir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/lib --bindir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/bin --datadir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/share --libexecdir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/libexec --sysconfdir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/etc --docdir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/doc/zlib-0.6.2.1 --htmldir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/doc/zlib-0.6.2.1 --haddockdir=/root/.stack/snapshots/x86_64-linux-tinfo6/1d8d3d2d1848c85724a4602c53666fa3959874eda6c0f7830bd85ea082eb5f39/8.6.5/doc/zlib-0.6.2.1 --dependency=base=base-4.12.0.0 --dependency=bytestring=bytestring-0.10.8.2 -f-non-blocking-ffi -f-pkg-config --exact-configuration --ghc-option=-fhide-source-paths
    #12 119.8     Process exited with code: ExitFailure 1
     
    #12 ERROR: executor failed running [/bin/bash -ol pipefail -c stack build]: exit code: 1
    -----
    > [8/9] RUN  stack build:
    -----
    executor failed running [/bin/bash -ol pipefail -c stack build]: exit code: 1
     
    Error: Docker build failed
    

    To reproduce

    I would guess this should reproduce with most haskell project (zlib is a common pain).

    I will try to repro and fix in vanilla nix locally.

    Expected behavior

    I would have expected the stack build to succeed.

    Environment

    Local:

    Ubuntu

    ❯ nixpacks --version
    nixpacks 0.0.17
    

    Railway project ID is 042095d5-6077-432c-ac60-351f0dffc072/service/267f19e6-9a03-428f-ab79-2f2beace373f

    bug 
    opened by commandodev 22
  • First-class support for nrwl/nx and applications within such a monorepo

    First-class support for nrwl/nx and applications within such a monorepo

    Feature request

    I am hosting a bigger application that lives within a monorepo managed by nx. Currently I want to selectively deploy services living in the apps folder. As a workaround I have configured the variables NIXPACKS_BUILD_CMD and NIXPACKS_START_CMD for each of my services to point it to the correct commands and start commands to run from within the monorepo. Those commands are npx nx build <app-name> --prod and node dist/apps/<app-name>/main.js respectively.

    Some form of configuration to specifically build and run applications by name without the need to duplicate those custom commands would be convenient.

    Motivation

    No response

    Contribution

    No response

    opened by ChristianIvicevic 17
  • error ```node:internal/modules/cjs/loader:1183```

    error ```node:internal/modules/cjs/loader:1183```

    i get this error if i run my code and the deploy is active after that he crash

    node:internal/modules/cjs/loader:1183
    return process.dlopen(module, path.toNamespacedPath(filename));
    ^
    Error: libuuid.so.1: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
    code: 'ERR_DLOPEN_FAILED'
    }
    Node.js v17.9.0
    
    opened by Remco0o 17
  • Rust diesel libmysqlclient

    Rust diesel libmysqlclient

    What does this PR address?

    Adds tests for the issue detailed in https://github.com/railwayapp/nixpacks/issues/328. Ive added the test and would also like to fix the underlying issue in this pr, but need assistance with this part.

    • [X] Make sure to follow GitHub's guide on creating PR.
    • [X] Did you read through contribution guidelines?
    • [ ] Did your changes require updates to the documentation? Have you updated those accordingly?
    • [ ] Did you write tests to cover your changes? Did it pass locally when running cargo test?
    • [ ] Have you run cargo fmt, cargo check and cargo clippy locally to ensure that CI passes?
    opened by FinnDore 16
  • Incremental caching

    Incremental caching

    NOTE: This is early PoC, feedback is welcomed!

    When building a docker image, There are two type of cache content that Docker maintain between builds:

    • Image layer caching (to help reduce the amount of layer downloaded from registry)
    • Mount/Incremental cache (to keep the files generated between builds, like /root/.npm)

    Both cache content are served/handled by the local Docker daemon, this means that an image built on specific Docker host. need to be built on the same host each time to take full advantage of caching capabilities

    This PR enables Nixpacks to work more smoothly in a cluster setup (Multiple Docker nodes accessing cache remotely) After build command runs (for example npm run build) the directories need to be cached (like /root/.npm) will be archived with tar and sent to a small HTTP server that has been started by Nixpacks to receive these files

    These tar files -if available- will be copied back to any newer image build. It will extracted to the right location inside the image to help build tools find out the files needed for the build without the needed to re-download it.

    From high level, these are the steps:

    • Get random free port & start Nixpacks web server with
    • Check if the provided incremental-cache image already exists in docker registry
    • Read cached directories from the provided image into the image we're building (using COPY --from=...)
    • Run build steps
    • tar cached directories (in case any updates happens to) & send to Nixpacks file server
    • loop on all tar files & run docker import against to create a "system file" image (an image that won't be started as a container)
    • Show a message that incremental cache image has been updated, to let user push it

    Numbers for sample tests:

    Clean build (no remote cache): 2m44s

    test2

    Clean build with remote cache (both layer cache + new incremental cache): 1m26s

    test4

    Clean build with incremental cache only: 2m46s

    test 6

    Another test case Clean build (no remote cache): 1m23s

    image

    Clean build with remote cache (both layer cache + incremental cache): 0m55s

    test3

    Clean build with Incremental cache only: 1m29s

    test 5 release/minor 
    opened by AhmedMozaly 14
  • Ignore files in .gitignore & show a warning when calling includes_file

    Ignore files in .gitignore & show a warning when calling includes_file

    Feature request

    If there is already a package-lock.json file in the codebase, And user added package-lock.json to .gitignore by mistake Running npm ci in this case will fail

    It's better to detect such case up front. Raise a clear error about, With a suggestion on how to fix For reference: https://github.com/railwayapp/nixpacks/blob/main/src/providers/node/mod.rs#L270

    Motivation

    No response

    Contribution

    No response

    enhancement 
    opened by AhmedMozaly 13
  • problem building a nixpack under gitpod

    problem building a nixpack under gitpod

    I am using gitpod as my dev environment as I learn about nixpacks. I can build the binary without any problem but I can't build a nitpack for the example node project. I'm not very familiar with rust so not really clear what the error message is indicating.

    Note, I am able to build locally on my Mac so its something to do with the gitpod environment. It looks like it fails doing a npm ci at the end of the docker build. My Mac has node 17 while gitpod is 16. Not sure if that's important.

    To reproduce the issue, create a gitpod workspace using https://gitpod.io/# + the GitHub repo URL. Then from the terminal run cargo run -- build examples/node --name node

    Here is the output.

    cargo run -- build examples/node --name node
        Finished dev [unoptimized + debuginfo] target(s) in 0.02s
         Running `target/debug/nixpacks build examples/node --name node`
    === Building (nixpacks v0.0.8) ===
    => Generated new build plan
    => Packages
        -> nodejs
    => Install
        -> npm ci
    => Build
        -> Skipping
    => Start
        -> npm run start
    => Building image with Docker
    Sending build context to Docker daemon  7.168kB
    Step 1/15 : FROM debian:bullseye-slim
     ---> bfbec70f8488
    Step 2/15 : RUN apt-get update && apt-get -y upgrade   && apt-get install --no-install-recommends -y locales curl xz-utils ca-certificates openssl   && apt-get clean && rm -rf /var/lib/apt/lists/*   && mkdir -m 0755 /nix && mkdir -m 0755 /etc/nix && groupadd -r nixbld && chown root /nix   && echo 'sandbox = false' > /etc/nix/nix.conf   && for n in $(seq 1 10); do useradd -c "Nix build user $n" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(command -v nologin)" "nixbld$n"; done
     ---> Using cache
     ---> 6b66b20f974c
    Step 3/15 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
     ---> Using cache
     ---> c550359f3833
    Step 4/15 : RUN set -o pipefail && curl -L https://nixos.org/nix/install | bash     && /nix/var/nix/profiles/default/bin/nix-collect-garbage --delete-old
     ---> Using cache
     ---> 8cd081977e35
    Step 5/15 : ENV   ENV=/etc/profile   USER=root   PATH=/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin   GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt   NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt   NIX_PATH=/nix/var/nix/profiles/per-user/root/channels
     ---> Using cache
     ---> 7e8e1d37c7e4
    Step 6/15 : RUN nix-channel --update
     ---> Using cache
     ---> 9fcce4c4d9bd
    Step 7/15 : RUN mkdir /app/
     ---> Using cache
     ---> da6c338bda53
    Step 8/15 : WORKDIR /app/
     ---> Using cache
     ---> ddab151a4376
    Step 9/15 : COPY environment.nix /app/
     ---> Using cache
     ---> d4e0409d43c1
    Step 10/15 : RUN nix-env -if environment.nix
     ---> Using cache
     ---> 361901493d55
    Step 11/15 : ARG NPM_CONFIG_PRODUCTION NODE_ENV
     ---> Running in 2ac92b375b9b
    Removing intermediate container 2ac92b375b9b
     ---> f97b63c6066e
    Step 12/15 : ENV NPM_CONFIG_PRODUCTION=$NPM_CONFIG_PRODUCTION NODE_ENV=$NODE_ENV
     ---> Running in 651966ee5147
    Removing intermediate container 651966ee5147
     ---> 518edade8cc9
    Step 13/15 : COPY . /app/
     ---> 8205e15c5e95
    Step 14/15 : RUN npm ci
     ---> Running in d1a655c5b9f7
    /nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node[1]: ../src/node_platform.cc:61:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
     1: 0xa66fa8 node::Abort() [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     2: 0xa67037  [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     3: 0xae82a5 node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     4: 0xae83d2 node::NodePlatform::NodePlatform(int, v8::TracingController*) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     5: 0xa270ff node::V8Platform::Initialize(int) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     6: 0xa2541b node::InitializeOncePerProcess(int, char**, node::InitializationSettingsFlags, node::ProcessFlags::Flags) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     7: 0xa255a9 node::InitializeOncePerProcess(int, char**) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     8: 0xa25608 node::Start(int, char**) [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
     9: 0x7f6b1de611d7  [/nix/store/m4g6lswi75b739cpdx8wfxlfmcazyks9-glibc-2.34-115/lib/libc.so.6]
    10: 0x7f6b1de61297 __libc_start_main [/nix/store/m4g6lswi75b739cpdx8wfxlfmcazyks9-glibc-2.34-115/lib/libc.so.6]
    11: 0x98be61 _start [/nix/store/7fy3g0bbiww61k7imi4bayfnjxmbs3cj-nodejs-16.15.0/bin/node]
    The command '/bin/bash -o pipefail -c npm ci' returned a non-zero code: 139
    Error: Docker build failed
    
    opened by anuaimi 10
  • RFC: Provider Caching

    RFC: Provider Caching

    Providers should be able to specify what files are necessary for the install step to allow for better Docker layer caching.

    For example, the NPM provider could specify that package.json is all that is necessary to install. If that files does not change between deploys, a cached layer can be used.

    Provider caching can be split up into a few different types

    1. Specify the files necessary to install so that only these files are keyed against when computing a cache hit/miss
    2. App/framework level caches (e.g. .next directory). These caches should be re-used even if the source code that generated the cache changes. For this level of caching we cannot take advantage of built in Docker layer caching and will likely require a persistent volume that can be shared between builds.

    This RFC will mainly focus on the first type.

    opened by coffee-cup 10
  • feat: suppport for NX monorepos

    feat: suppport for NX monorepos

    What does this PR address?

    Out of the box support for NX mono repos. ( nexjs apps, express apps and apps that build to an index.js )

    • [X] Make sure to follow GitHub's guide on creating PR.
    • [x] Did you read through contribution guidelines?
    • [x] Did your changes require updates to the documentation? Have you updated those accordingly? - New env var so yes?
    • [x] Did you write tests to cover your changes? Did it pass locally when running cargo test?
    • [x] Have you run cargo fmt, cargo check and cargo clippy locally to ensure that CI passes?
    opened by FinnDore 9
  • use absolute paths for compatibility with podman

    use absolute paths for compatibility with podman

    This PR... resolves railwayapp/nixpacks/discussions/121 by using absolutes paths over relative paths for mount points as podman is currently incompatible with docker's behavior. There is an issue upstream to fix this but it would be faster to work around the issue downstream rather then fix it upstream in buildah and waiting for a podman issue to include it.

    release/patch 
    opened by Lunarequest 8
  • NodeJS runtime error

    NodeJS runtime error

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Describe the bug

    (originally asked in the Railway discord server)

    I’m getting some weird errors when starting my app, only started when I switched to nixpacks.

    1: 0xa673d8 node::Abort() [node]
    2: 0xa67467  [node]
    3: 0xae9422 node::WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int) [node]
    4: 0xae9552 node::NodePlatform::NodePlatform(int, v8::TracingController*) [node]
    5: 0xa271bf node::V8Platform::Initialize(int) [node]
    6: 0xa254db node::InitializeOncePerProcess(int, char**, node::InitializationSettingsFlags, node::ProcessFlags::Flags) [node]
    7: 0xa25669 node::InitializeOncePerProcess(int, char**) [node]
    8: 0xa256c8 node::Start(int, char**) [node]
    9: 0x7f2b5d602237  [/nix/store/k56d9sk88pvrqhvwpa6msdf8gpwnimf6-glibc-2.34-210/lib/libc.so.6]
    10: 0x7f2b5d6022f5 __libc_start_main [/nix/store/k56d9sk88pvrqhvwpa6msdf8gpwnimf6-glibc-2.34-210/lib/libc.so.6]
    11: 0x98be71 _start [node]
    

    To reproduce

    No response

    Expected behavior

    No response

    Environment

    Node.js project on Railway. Wasn’t quite sure what information would be helpful so there’s not much here, but I’d be open to provide more information as requested.

    bug 
    opened by mrhappyma 8
  • Ruby: Rails build fails when configured as an api

    Ruby: Rails build fails when configured as an api

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Describe the bug

    I ran into a build failure when attempting to deploy a new Rails API to Railway using the railway up command.

    It appears that the build fails when it tries to run this rake task assets:precompile

    Screen Shot 2023-01-03 at 7 10 01 PM

    This is because when you create a rails project with the --api flag it skips all the views, assets, etc. as outlined in the Rails docs here, so the assets:precompile task does not exist.

    I think this is the function that probably needs to be updated

    It looks like you're looking within the config/application.rb file. Perhaps you can add some logic to look for the config.api_only = true line and adjust the build settings based on that.

    Screen Shot 2023-01-03 at 7 18 54 PM

    To reproduce

    1. In the Railway dashboard, create a new empty project
    2. On your local machine, create a new rails API with a postgres db rails new my_api --api --database=postgresql
    3. Create and migrate the db rails db:{create,migrate}
    4. Back in the Railway dashboard click the button at the bottom to set up your project locally
    5. Copy the Railway link to connect to the Railway project and paste it into your terminal
    6. Run railway up

    Expected behavior

    I would expect the build to succeed.

    Environment

    MacOS 12.3.1

    Screen Shot 2023-01-03 at 11 02 01 PM bug 
    opened by taphill 1
  • Golang Start Command

    Golang Start Command

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    Describe the bug

    Nix pack works fine for building a default container. But when I start adding custom start commands, something fails.

    Here is a working build & deploy, without start commands

    image image

    Builds fine but it's just using the default start command.

    Here is a build with start commands, it fails

    ==============
    Using Nixpacks
    ==============
    context: ed2947ad0e8ecf616927e0060d4c0270
     
    ╔═══════════════ Nixpacks v1.0.2 ══════════════╗
    ║ setup      │ go                              ║
    ║──────────────────────────────────────────────║
    ║ install    │ go mod download                 ║
    ║──────────────────────────────────────────────║
    ║ build      │ go build -o out                 ║
    ║──────────────────────────────────────────────║
    ║ start      │ ./out serve --http=0.0.0.0:8080 ║
    ╚══════════════════════════════════════════════╝
     
     
    #1 [internal] load build definition from Dockerfile
     
    #1 sha256:e8bb16e8b634bd9bebc0c66b16d603251cefc3f0a6271aa60196a5fd4ae5bff9
    #1 transferring dockerfile: 2.22kB done
    #1 DONE 0.1s
     
    #2 [internal] load .dockerignore
    #2 sha256:83ba8f630c928851beada741a87c4013a3d1396fd70fcd285f0cf5b60ba967ae
    #2 transferring context: 2B done
    #2 DONE 0.1s
     
     
    #4 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1671044363
    #4 sha256:d2df4677b7c4c8365aa628f14d4cbdd9867466b6b454c21060180de4b7936a2e
     
    #4 DONE 0.2s
     
    #3 [internal] load metadata for docker.io/library/ubuntu:jammy
    #3 sha256:5e41972c0cdee05640f3ed85ad5e7dca92c5a589ced43badaf14d81466f891ae
     
    #3 DONE 0.3s
     
    #7 [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1671044363@sha256:4df36f942799b8b727c8648ca4fa05d9cd2526e41e7994665082c0f7ef03d95b
    #7 sha256:a20b8f1ac783d9d00f7c673a9ef0cf3b8f0aaee89856a86f7aff78cda1934897
    #7 DONE 0.0s
     
    #5 [stage-1 1/5] FROM docker.io/library/ubuntu:jammy@sha256:27cb6e6ccef575a4698b66f5de06c7ecd61589132d5a91d098f7f3f9285415a9
    #5 sha256:6f3b08c859f255cb37cf3502bfa9aed8c925823cc7863ca0013f3d26e621ba0a
    #5 DONE 0.0s
     
    #9 [internal] load build context
    #9 sha256:5ba5de9ca6e5738400782728f92c78b5d56c3c0483e12cb60e36c0f1f9552217
     
    #9 transferring context: 47.88MB 0.3s done
    #9 DONE 0.4s
     
    #8 [stage-0 2/8] WORKDIR /app/
    #8 sha256:46f35bb14209f31cddb6d0e80d42b3ceb58d2f45672a3486e22a069140ac06a3
    #8 CACHED
     
    #10 [stage-0 3/8] COPY .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix
    #10 sha256:70ce6a4b3804a2f877ed74a578551f50633788dede0695d433b48111d338f981
    #10 CACHED
     
    #11 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix && nix-collect-garbage -d
    #11 sha256:59b918cc061dba6437fa95b37561145b04058cd12ce1167115d3a26179aa4c47
    #11 CACHED
     
    #12 [stage-0 5/8] COPY . /app/.
    #12 sha256:147cc57d0c70d995b1d9c5abc4d3807c3a8a843574fd4543384d357f8987a46a
     
    #12 DONE 0.2s
     
    #13 [stage-0 6/8] RUN --mount=type=cache,id=s/0098b1a9-7adb-49c6-8db1-ed7f1c65db8d-/root/cache/go-build,target=/root/.cache/go-build go mod download
    #13 sha256:f7e5740124829bd271b77f19fd3cafa34cb163037e849ef9fdf721bfc4647361
     
    #13 DONE 8.2s
     
    #14 [stage-0 7/8] COPY . /app/.
    #14 sha256:8eca9da03455fe36e13e2875747fa89fbbde0b733b9fda696447b4ea3c254394
     
    #14 DONE 0.2s
     
     
    #15 [stage-0 8/8] RUN --mount=type=cache,id=s/0098b1a9-7adb-49c6-8db1-ed7f1c65db8d-/root/cache/go-build,target=/root/.cache/go-build go build -o out
     
    #15 sha256:788c2e178bb565b2ba5742e5f39bca0fea5b6166122b6e8771e53932e3bd5d56
     
    #15 DONE 2.7s
     
     
    #6 [stage-1 2/5] WORKDIR /app/
    #6 sha256:b562f93b81a88474f0a0d1f49b4aedecd6daa1817f0bb2a067dec049c0a7db1c
    #6 CACHED
    
    #19 exporting layers done
    #19 writing image sha256:b7b25b27a998eb25c2ab8f3d61263df773a08f71720434d031080d1cd237ea45
     
    #19 writing image sha256:b7b25b27a998eb25c2ab8f3d61263df773a08f71720434d031080d1cd237ea45 0.0s done
    #19 naming to us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/0c560053-13c4-41e8-b9be-287fe67a6dec/service/0098b1a9-7adb-49c6-8db1-ed7f1c65db8d:9e6482aa-20a2-4721-8060-6098db2fa736 0.0s done
    #19 DONE 0.1s
     
    #20 exporting cache
    #20 sha256:2700d4ef94dee473593c5c614b55b2dedcca7893909811a8f2b48291a1f581e4
    #20 preparing build cache for export 0.1s done
    #20 DONE 0.1s
     
    === Successfully Built! ===
     
    Run:
    docker run -it us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/0c560053-13c4-41e8-b9be-287fe67a6dec/service/0098b1a9-7adb-49c6-8db1-ed7f1c65db8d:9e6482aa-20a2-4721-8060-6098db2fa736
     
    Build time: 15.52 seconds
     
    ================
    Publishing Image
    ================
    The push refers to repository [us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/0c560053-13c4-41e8-b9be-287fe67a6dec/service/0098b1a9-7adb-49c6-8db1-ed7f1c65db8d]
    Preparing  07458905b58b
    Preparing  5f70bf18a086
    Preparing  8112635cc30b
    Preparing  1a22f5485129
    Preparing  6515074984c6
    Waiting  6515074984c6
    Layer already exists  8112635cc30b
    Layer already exists  5f70bf18a086
    Layer already exists  1a22f5485129
    Layer already exists  6515074984c6
    Pushing [>                                                  ]  546.8kB/98.11MB 07458905b58b
    Pushing [=>                                                 ]  2.218MB/98.11MB 07458905b58b
    Pushing [=>                                                 ]  3.889MB/98.11MB 07458905b58b
    Pushing [==>                                                ]   5.56MB/98.11MB 07458905b58b
    Pushing [===>                                               ]  7.231MB/98.11MB 07458905b58b
    Pushing [====>                                              ]  8.903MB/98.11MB 07458905b58b
    Pushing [=====>                                             ]  11.13MB/98.11MB 07458905b58b
    Pushing [======>                                            ]   12.8MB/98.11MB 07458905b58b
    Pushing [=======>                                           ]  14.47MB/98.11MB 07458905b58b
    Pushing [========>                                          ]   16.7MB/98.11MB 07458905b58b
    Pushing [=========>                                         ]  18.93MB/98.11MB 07458905b58b
    Pushing [==========>                                        ]  21.16MB/98.11MB 07458905b58b
    Pushing [===========>                                       ]  23.39MB/98.11MB 07458905b58b
    Pushing [============>                                      ]  25.06MB/98.11MB 07458905b58b
    Pushing [==============>                                    ]  28.96MB/98.11MB 07458905b58b
    Pushing [================>                                  ]  31.74MB/98.11MB 07458905b58b
    Pushing [=================>                                 ]  33.97MB/98.11MB 07458905b58b
    Pushing [==================>                                ]   36.2MB/98.11MB 07458905b58b
    Pushing [===================>                               ]  37.87MB/98.11MB 07458905b58b
    Pushing [=====================>                             ]  41.21MB/98.11MB 07458905b58b
    Pushing [======================>                            ]     44MB/98.11MB 07458905b58b
    Pushing [=======================>                           ]  46.23MB/98.11MB 07458905b58b
    Pushing [========================>                          ]   48.4MB/98.11MB 07458905b58b
    Pushing [=========================>                         ]  50.07MB/98.11MB 07458905b58b
    Pushing [==========================>                        ]  51.74MB/98.11MB 07458905b58b
    Pushing [===========================>                       ]  53.41MB/98.11MB 07458905b58b
    Pushing [============================>                      ]  55.09MB/98.11MB 07458905b58b
    Pushing [============================>                      ]  56.76MB/98.11MB 07458905b58b
    Pushing [==============================>                    ]  58.98MB/98.11MB 07458905b58b
    Pushing [==============================>                    ]  60.66MB/98.11MB 07458905b58b
    Pushing [===============================>                   ]  62.33MB/98.11MB 07458905b58b
    Pushing [================================>                  ]  64.56MB/98.11MB 07458905b58b
    Pushing [==================================>                ]  66.78MB/98.11MB 07458905b58b
    Pushing [===================================>               ]  69.01MB/98.11MB 07458905b58b
    Pushing [====================================>              ]  71.24MB/98.11MB 07458905b58b
    Pushing [=====================================>             ]  73.47MB/98.11MB 07458905b58b
    Pushing [=======================================>           ]  76.81MB/98.11MB 07458905b58b
    Pushing [========================================>          ]  80.15MB/98.11MB 07458905b58b
    Pushing [=========================================>         ]  81.82MB/98.11MB 07458905b58b
    Pushing [==========================================>        ]   83.5MB/98.11MB 07458905b58b
    Pushing [===========================================>       ]  85.72MB/98.11MB 07458905b58b
    Pushing [============================================>      ]  87.95MB/98.11MB 07458905b58b
    Pushing [=============================================>     ]  90.18MB/98.11MB 07458905b58b
    Pushing [===============================================>   ]  92.41MB/98.11MB 07458905b58b
    Pushing [================================================>  ]  94.64MB/98.11MB 07458905b58b
    Pushing [=================================================> ]  96.31MB/98.11MB 07458905b58b
    Pushing [==================================================>]  98.12MB 07458905b58b
    Pushed  07458905b58b
    9e6482aa-20a2-4721-8060-6098db2fa736: digest: sha256:a3ce8dba1ef09d3c3e0928122f45b9334e174c3c3a60fda4eaf4954b5adda6d4 size: 1366
     
     
    ========================
    Container Start Failure!
    ========================
    rpc error: code = Unknown desc = Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./out serve --http=0.0.0.0:8080": stat ./out serve --http=0.0.0.0:8080: no such file or directory: unknown
     
    

    To reproduce

    Build a standard golang application with commands. I am using pocketbase.

    Add start commands to add to the run command.

    Expected behavior

    The build to go through like standard, but with start commands.

    Environment

    Nixpacks 18, on railway

    bug 
    opened by Fish1 1
  • Support `cacheDirctories` field in `package.json`

    Support `cacheDirctories` field in `package.json`

    This PR reads cacheDirectories in package.json if it exists and adds it to the build cache. This also adds a helper function to prevent duplicate cache directories. This is mainly for better compatibility with the Heroku Buildpack for Node.

    Most of the snapshot changes are just sorting differences, and the contents are actually the same (this is because we use a set to remove duplicates).

    • [x] Tests are added/updated if needed
    • [x] Docs are updated if needed
    release/patch stale 
    opened by Milo123459 1
  • Feature Request - Alpine Images

    Feature Request - Alpine Images

    Feature request

    Currently the images output (at least for Node which is what I have tried) are ubuntu based. I have seen on Dockerhub there are also Debian images.

    I would like to build alpine images for my production node applications.

    Motivation

    Alpine images are smaller (200MB compared to 600MB for the application I have tested with) Alpine images have less security vulnerabilities.

    Alpine: Screen Shot 2022-12-17 at 08 51 36

    Nixpacks Ubuntu: Screen Shot 2022-12-17 at 08 51 43

    Others have also shown interest: https://github.com/railwayapp/nixpacks/issues/419#issuecomment-1220756677

    Contribution

    I would be happy to test any pre-release features to ensure stability.

    enhancement 
    opened by wSedlacek 4
  • Install ruby with rbenv

    Install ruby with rbenv

    This PR updates the Ruby provider to install Ruby with rbenv instead of rvm.

    Rbenv has a few benefits over rvm

    • Handles installing Openssl 1.1 automatically for Ruby versions <3.1.0
    • Installs in about half the time as it does for rvm 134s vs 269s (shocked how close that is to exactly 50% tbh)
    release/minor stale 
    opened by coffee-cup 1
  • Scala sbt support

    Scala sbt support

    Feature request

    Provide support for Scala sbt projects to compile to jar files that can be deployed similarly to the way maven and gradle is handled

    Motivation

    I want to build docker images for my sbt application while currently only maven and gradle are supported.

    Contribution

    Would love to help by sending a PR

    new provider 
    opened by yzia2000 0
Releases(v1.0.3)
Owner
Railway
Infrastructure, Instantly
Railway
docker-rust — the official Rust Docker image

About this Repo This is the Git repo of the Docker official image for rust. See the Docker Hub page for the full readme on how to use this Docker imag

The Rust Programming Language 321 Dec 11, 2022
A simple gtk4/libadwaita software center to easily install and manage nix packages

Nix Software Center A graphical app store for Nix built with libadwaita, GTK4, and Relm4. Heavily inspired by GNOME Software. Features Install package

Victor Fuentes 169 Dec 30, 2022
Generate Nix packages from URLs

Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more

Nix community projects 130 Feb 5, 2023
A `nix` and `nix-shell` wrapper for shells other than `bash`

nix-your-shell A nix and nix-shell wrapper for shells other than bash. nix develop and nix-shell use bash as the default shell, so nix-your-shell prin

Mercury 15 Apr 10, 2023
Progress In Nix - Pacman inspired frontend for Nix

Progress In Nix Pinix is a Pacman inspired frontend for Nix. It wraps a regular Nix command and replaces the output with a more modern and informative

Rémi Dupré 23 Mar 9, 2024
Build tool for custom setups of docker containers. Docker compose didn't offer enough, Kubernetes offered too much. Carbon is the in-between.

docker abstraction layer with added flair Fast travel: Tips Contributing How it works Installation Help This tool started its life as a way to make de

akhara 3 Nov 10, 2022
Demo app duplicated in 5 languages (Go/JavaScript/Python/Ruby/Rust) showing how to go from source code to container image using melange+apko

hello-melange-apko ?? This repo contains an example app duplicated across 5 languages showing how to: Package source code into APKs using melange Buil

Chainguard 16 Jan 23, 2023
Very small rust docker image

mini-docker-rust Very small rust docker image. This is an example project on how to build very small docker images for a rust project. The resulting i

null 155 Jan 1, 2023
A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

Jake Wharton 256 Dec 27, 2022
A container image builder tool for OCI (distrobox/toolbox, also podman/docker)

Distrobox Boost A container image builder tool for Open Container Initiative (distrobox/toolbox, also podman/docker). Distrobox is good enough in runn

xz-dev 6 Aug 15, 2023
Rust + htmx + tailwind + nix + redb + twind demo web app

htmx sorta A demo project where I learn and play with my "Rust web stack": Rust Nix flakes for building and dev shell redb Rust local key-value store

Rustshop 19 Oct 5, 2023
GUI app for managing Docker

dockeye GUI app for managing Docker Installation Prebuilt packages Download one of the archives available on the releases page and extract it somewher

Wojciech Kępka 397 Jan 3, 2023
Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.

nixseparatedebuginfod Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed

Guillaume Girol 16 Mar 6, 2023
Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes

What is Lust? Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes with scaling in mind.

Harrison Burt 242 Dec 22, 2022
Save image from your clipboard 📋 as an image file directly from your command line! 🔥

Clpy ?? Save copied image from clipboard as an image file directly from your command line! Note It works only on windows as of now. I'll be adding sup

Piyush Suthar 13 Nov 28, 2022
Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Jacob 258 Dec 30, 2022
Rust Lean Image Viewer - Fast and configurable image viewer inspired by JPEGView by David Kleiner

Rust Lean Image Viewer - Fast and configurable image viewer inspired by JPEGView by David Kleiner

3top1a 4 Apr 9, 2022
Conference Monitoring Project based on Image Recognition that uses Rust Language and AWS Rekognition service to get the level of image similarity.

Conference Monitoring System based on Image Recognition in Rust This is a Conference Monitoring Project based on Image Recognition that uses Rust Lang

Pankaj Chaudhary 6 Dec 18, 2022
Web-app that simulates different types of color blindness from a user-provided input image.

What is Dalted? Web-app that simulates different types of color blindness from a user-provided input image. Resources The color blindness simulation i

Jorge Carrasco 18 Dec 20, 2022
👩‍❤️‍💋‍👩 Synchronize installed packages on multiple machines

emplace Command-line tool to mirror installed software on multiple machines. Features Outputs a human-readable (RON) file to sync between machines: .e

Thomas Versteeg 202 Dec 24, 2022