Commit graph

9 commits

Author SHA1 Message Date
joeduffy af222c48a3 Add some Dockerfile metadata labels 2018-10-01 16:30:44 -07:00
joeduffy 2499539afb Add the ability to have a stacks map file
For CI situations, we'll support a simple stacks map file, e.g.

    {
        "refs/heads/master": "production",
        "refs/heads/testing": "test'
    }

and, when PULUMI_CI is set, we'll use it to select the stack.

This is purely for experimental purposes; we're not sure this is
exactly what we want right now, but it's better than the manual
munging we've been doing with various bash scripts, etc. right now.
2018-10-01 13:45:26 -07:00
joeduffy eeb7da9eda Properly install Node.js 10.x 2018-09-30 08:20:29 -07:00
joeduffy d3ed7de33b Use a thin script wrapper for the entrypoint
This adds a package installation step just before calling the
`pulumi` CLI, making it easier to just volume mount a project
without needing to have `npm install`ed its contents yet.
2018-09-30 08:09:57 -07:00
joeduffy bf33f8113d Symlink node as nodejs
On Debian, the Node.js binary is named `nodejs`, whereas all our
scripts and tools assume `node`. This is a standard problem. To
address it, add symlink. Also move other binaries under /usr/bin.
2018-09-30 07:49:52 -07:00
joeduffy 61662d2e5f Install Node.js in the runtime Docker container 2018-09-30 07:34:11 -07:00
joeduffy 17a95c30b0 Install ca-certificates
Without this package, /etc/ssl/certs is empty, and the Pulumi CLI
will fail perpetually with

    error: problem logging in: getting user info from
        https://api.pulumi.com: performing HTTP request:
        Get https://api.pulumi.com/api/user: x509: certificate
        signed by unknown authority
2018-09-30 07:09:58 -07:00
joeduffy b6724c7892 Lock to specific dep version
This changes the Dockerfile to install the same specific dep version
we use in CI. To ensure we don't end up duplicating logic, it refactors
the versions themselves into a separate sourceable script that's shared
between both the Dockerfile and our existing CI scripts.
2018-09-29 16:33:21 -07:00
joeduffy 162157c1a7 Add a Dockerfile for the Pulumi CLI
This introduces a Dockerfile for the Pulumi CLI. This makes it
easier to develop and test the engine in a self-contained environment,
in addition to being suitable for running the actual CLI itself.

For instance,

    $ docker run pulumi/pulumi -e "PULUMI_ACCESS_TOKEN=x" up

will run the Pulumi program mounted under the /app volume. This will
be used in some upcoming CI/CD scenarios.

This uses multi-stage builds, and Debian Stretch as the base, for
relatively fast and lean build times and resulting images. We are
intentional about restoring dep packages independent of the actual
source code so that we don't end up needlessly re-depping, which can
consume quite a bit of time. After fixing
https://github.com/pulumi/pulumi/issues/1986, we should explore an
Alpine base image option.

I made the decision to keep this image scoped to just the Go builds.
Therefore, none of the actual SDK packages themselves are built, just
the engine, CLI, and language plugins for Node.js, Python, and Go.
It's possible to create a mega-container that has all of these full
environments so that we can rebuild them too, but for now I figured
it was better to rely on package management for them.

Another alternative would have been to install released binaries,
rather than building them. To keep the useful flow for development,
however, I decided to go the build route for now. If we build at the
same hashes, the resulting binaries "should" be ~identical anyhow.

I've created a pulumi/pulumi Docker Hub repo that we can publish this
into. For now, there is no CI publishing of the image.

This fixes pulumi/pulumi#1991.
2018-09-29 11:48:21 -07:00