Skip to content

Instantly share code, notes, and snippets.

@KrishnaPravin
Last active March 23, 2021 07:56
Show Gist options
  • Save KrishnaPravin/2982a48b79d89bb85f98ef0d7c331ef9 to your computer and use it in GitHub Desktop.
Save KrishnaPravin/2982a48b79d89bb85f98ef0d7c331ef9 to your computer and use it in GitHub Desktop.

Revisions

  1. KrishnaPravin revised this gist Mar 23, 2021. 3 changed files with 9 additions and 4 deletions.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@ FROM node:alpine

    COPY . .

    ARG APP_ENV=build
    ARG APP_ENV=dev

    RUN npm run build:$APP_ENV
    7 changes: 6 additions & 1 deletion build.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,7 @@
    # Docker version 20.10.5, build 55c4c88
    docker build . --progress plain --no-cache --build-arg APP_ENV=asd

    # Default argument
    docker build . --progress plain --no-cache

    # Passed argument
    docker build . --progress plain --no-cache --build-arg APP_ENV=prod
    4 changes: 2 additions & 2 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,8 @@
    "main": "index.js",
    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "echo \"hello KKKKKKKKKKKKKKKKKKKKK\"",
    "build:asd": "echo \"hello AAAAAAAAAAAAAAAAAAAAAA\""
    "build:dev": "echo \"hello KKKKKKKKKKKKKKKKKKKKK\"",
    "build:prod": "echo \"hello AAAAAAAAAAAAAAAAAAAAAA\""
    },
    "author": "",
    "license": "ISC"
  2. KrishnaPravin revised this gist Mar 23, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions build.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    # Docker version 20.10.5, build 55c4c88
    docker build . --progress plain --no-cache --build-arg APP_ENV=asd
  3. KrishnaPravin revised this gist Mar 23, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions build.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    docker build . --progress plain --no-cache --build-arg APP_ENV=asd
  4. KrishnaPravin created this gist Mar 23, 2021.
    7 changes: 7 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    FROM node:alpine

    COPY . .

    ARG APP_ENV=build

    RUN npm run build:$APP_ENV
    13 changes: 13 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    {
    "name": "docker",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "echo \"hello KKKKKKKKKKKKKKKKKKKKK\"",
    "build:asd": "echo \"hello AAAAAAAAAAAAAAAAAAAAAA\""
    },
    "author": "",
    "license": "ISC"
    }