# In dockerfile.alpine.sh, build-arg TAG\_SUFFIX=minimal is not working

**URL:** <https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972>\
**Category:** General\
**Tags:** docker\
**Created:** [19 November 2021 01:23 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972 "2021-11-19T01:23:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [19 November 2021 01:23 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/1 "2021-11-19T01:23:19Z")

</div>

resulting images always include devtools.  
Hardware: Raspberry PI 4 with 8Gb Ram  
OS: PI OS Bullseye Full distribution  
Docker standard image : 2.1.3 is running OK  
Docker Custom Git freshly clone.

using docker.alpine.sh

Resulting image for TAG\_SUFFIX=default is about 415 Mb  
image with TAG\_SUFFIX=minimal is about 415 Mb

In both case the execution log always shows devtools installation.  
here is my docker.alpine.sh with minimal suffix

```auto

#!/bin/bash
export NODE_RED_VERSION=$(grep -oE "\"node-red\": \"(\w*.\w*.\w*.\w*.\w*.)" package.json | cut -d\" -f4)

echo "#########################################################################"
echo "node-red version: ${NODE_RED_VERSION}"
echo "#########################################################################"

docker build --rm --no-cache \
    --build-arg ARCH=arm32v7 \
    --build-arg NODE_VERSION=12 \
    --build-arg NODE_RED_VERSION=${NODE_RED_VERSION} \
    --build-arg OS=alpine \
    --build-arg BUILD_DATE="$(date +"%Y-%m-%dT%H:%M:%SZ")" \
    --build-arg TAG_SUFFIX=minimal \
    --file Dockerfile.custom \
    --tag testing:nr136custmin .

```

I do not have to much experience on docker but I have made some modifications to scripts that  
seems to produce a correct image.(without devtools)

---

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [19 November 2021 01:32 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/2 "2021-11-19T01:32:26Z")

</div>

Modified Dockerfile.custom  
removed hardcoded value for TAG\_SUFFIX

```auto
...
#### Stage RELEASE #####################################################################################################
FROM base AS RELEASE
ARG BUILD_DATE
ARG BUILD_VERSION
ARG BUILD_REF
ARG NODE_RED_VERSION
ARG ARCH
ARG TAG_SUFFIX
....

```

Modified scripts/install\_devtools.sh  
"minimal" instead "-minimal"

```auto

#!/bin/bash
set -ex

# Installing Devtools
if [[${TAG_SUFFIX} != "minimal"]]; then
  echo "Installing devtools"
  apk add --no-cache --virtual devtools build-base linux-headers udev python2 python3
else
  echo "Skip installing devtools"
fi
-----------

```

After modifications the resulting iamge is about 218 Mb  
and the image is running fine.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [19 November 2021 09:04 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/3 "2021-11-19T09:04:46Z")

</div>

Raise a PR for review

But understand that the `install_devtools.sh` script needs to be shared with the automated build and that will always have `-minimal` as the tag.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [19 November 2021 10:33 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/4 "2021-11-19T10:33:18Z")

</div>

> <https://github.com/node-red/node-red-docker/pull/290>
>
> Also bump default NodeJS version to 14 for custom builds
> 
> \<!--
> \## Before you …hit that Submit button....
> 
> Please read our \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> before submitting a pull-request.
> 
> \## Types of changes
> 
> What types of changes does your code introduce?
> Put an \`x\` in the boxes that apply
> \--\>
> 
> \- \[x\] Bugfix (non-breaking change which fixes an issue)
> \- \[\] New feature (non-breaking change which adds functionality)
> 
> \<!--
> If you want to raise a pull-request with a new feature, or a refactoring
> of existing code, it \*\*may well get rejected\*\* if it hasn't been discussed on
> the \[forum\](https://discourse.nodered.org) or
> \[slack team\](https://nodered.org/slack) first.
> 
> \--\>
> 
> \## Proposed changes
> https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972
> 
> Made the \`install\_devtools.sh\` script match both \`minimal\` and \`-minimal\`
> 
> Also updated the docs to reflect that this setting only applies to Alpine builds
> 
> \## Checklist
> 
> 
> \- \[x\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> \- \[\] For non-bugfix PRs, I have discussed this change on the mailing list/slack team.
> \- \[x\] I have run \`grunt\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

---

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [19 November 2021 15:27 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/5 "2021-11-19T15:27:28Z")

</div>

Hi  
docker.alpine.sh is calling Dockerfile.custom  
In Dockerfile.custom many arguments are reassign  
In Dockerfile.debian same thing happen

Is it ok to change Dockerfile.custom.sh and Dockerfile.debian.sh and remove those reassignement so that the only place they are assigned is from docker command in docker.alpine.sh and docker.debian.sh

Again I don't have a lot of experience with docker.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [19 November 2021 17:58 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/6 "2021-11-19T17:58:48Z")

</div>

The entries in the Dockerfile's are purely default values if none are passed in on the command line.

---

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [19 November 2021 18:59 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/7 "2021-11-19T18:59:46Z")

</div>

Yep!  
This is working good.

Thanks for your help

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 December 2021 18:59 UTC](https://discourse.nodered.org/t/in-dockerfile-alpine-sh-build-arg-tag-suffix-minimal-is-not-working/53972/8 "2021-12-03T18:59:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
