npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gperdomor/nx-tools-nx-docker

v1.0.0-alpha.5

Published

![Docker builder](https://github.com/gperdomor/nx-tools/workflows/Docker%20builder/badge.svg)

Downloads

4

Readme

nx-docker

Docker builder

This builder provides a wrapper around github docker action

Getting started

The first step is configure the builder in your angular.json or workspace.json, so add something like this to every project you need to dockerize:

"docker": {
  "builder": "@nx-tools/nx-docker:build",
  "options": {
    "repository": "gperdomor/api",
    "socket": "/var/run/docker.sock" // required to run local builds in your machine, make sure docker is running
  }
}

You can customize your ci using environment variables

"docker": {
  "builder": "@nx-tools/nx-docker:build",
  "options": {
    "repository": "$PROJECT_PATH/api",
    "dockerfile": "apps/api/Dockerfile",
    "registry": "$CI_REGISTRY",
    "username": "$CI_REGISTRY_USER",
    "password": "$CI_REGISTRY_PASSWORD",
    "tags": "latest",
    "push": true,
    "socket": "/var/run/docker.sock"
  }
}

To check all possible options please check the official docker action or this schema.json file

Use with Gitlab CI

To use with Gitlab CI just only need add something like this to your pipeline:

build:
  image: gperdomor/nx-docker:19.03.12-node-14.8-alpine
  services:
    - docker:19.03.12-dind
  variables:
    GIT_DEPTH: 0
    DOCKER_TLS_CERTDIR: '/certs'
  script:
    - npm i
    - npm run nx affected -- --target=docker --base=remotes/origin/master

Because this is a wrapper of the Github Action, you need set GITHUB_SHA and GITHUB_REF if tag_with_sha: true and tag_with_ref: true

Also you need configure other environment variables depending on your builder options,

Use with Github Actions

To use with Github Actions just only need add something like this to your workflow

name: Build
# This workflow is triggered on pushes to the repository.
on: [push]

jobs:
  build:
    name: Docker build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v1
        with:
          node-version: 13.x

      - name: Install dependencies
        run: npm ci

      - name: 'nx build'
        run: npm run nx affected -- --target=docker --all
        env: # Add custom variables needed
          CI_REGISTRY: docker.pkg.github.com
          CI_PROJECT_PATH: ${{ github.repository }}
          CI_REGISTRY_USER: gperdomor
          CI_REGISTRY_PASSWORD: ${{ github.token }}