diff --git a/.circleci/config.yml b/.circleci/config.yml index 38b83cd1e2..36e7eba451 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -116,7 +116,7 @@ workflows: - run: name: Build Multistage (smaller) container command: | - docker build -f docker/Dockerfile -t nushell/nu:devel . + docker build --build-arg FROMTAG=devel -f docker/Dockerfile -t nushell/nu:devel . - run: name: Publish Development Docker Tags command: | diff --git a/README.md b/README.md index 08c2911054..381463c03d 100644 --- a/README.md +++ b/README.md @@ -51,19 +51,40 @@ The following optional features are currently supported: ## Docker -Optionally, you can build a container with nu installed using the [Dockerfile](Dockerfile): +If you want to pull a pre-built container, you can browse tags for the [nushell organization](https://quay.io/organization/nushell) +on Quay.io. Pulling a container would come down to: ```bash -$ docker build -t nu . +$ docker pull quay.io/nushell/nu +$ docker pull quay.io/nushell/nu-base +``` + +Both "nu-base" and "nu" provide the nu binary, however nu-base also includes the source code at `/code` +in the container and all dependencies. + +Optionally, you can also build the containers locally using the [dockerfiles provided](docker): +To build the base image: + +```bash +$ docker build -f docker/Dockerfile.nu-base -t nushell/nu-base . ``` -And then run the container: +And then to build the smaller container (using a Multistage build): ```bash -$ docker run -it nu +$ docker build -f docker/Dockerfile -t nushell/nu . +``` + +Either way, you can run either container as follows: + +```bash +$ docker run -it nushell/nu-base +$ docker run -it nushell/nu /> exit ``` +The second container is a bit smaller, if size is important to you. + # Philosophy Nu draws inspiration from projects like PowerShell, functional programming languages, and modern cli tools. Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure. For example, when you list the contents of a directory, what you get back is a list of objects, where each object represents an item in that directory. These values can be piped through a series of steps, in a series of commands called a 'pipeline'. diff --git a/docker/Dockerfile b/docker/Dockerfile index d74364b6fa..c72ba7f9db 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM nushell/nu-base as base +ARG FROMTAG=latest +FROM nushell/nu-base:${FROMTAG} as base FROM rust:1.37-slim COPY --from=base /usr/local/bin/nu /usr/local/bin/nu ENTRYPOINT ["nu"]