Open TasukuUno opened 4 years ago
hmm I imagine it should be linux/amd64, I'll boot up an Alpine container and see what's up, must not be detecting the env correctly
sounds like you have to compile with musl-gcc for Alpine, I'll open an issue in my gobinaries.com repo (still closed source ATM)
any progress or easy alternative?
@williamoliveira not yet, haven't had time to work on it
ok, I found an alternative, the yarn autoclean
command
Current workaround using goreleaser (tested on node:14-alpine
):
FROM node:14-alpine as builder
# Add dependencies
RUN apk add curl bash --no-cache
# Install node-prune
RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash -s -- -b /usr/local/bin
# Build app
RUN npm install && (...)
# Run cleanup necessary dependencies
RUN npm prune --production && node-prune
Unfortunately it will install v1.0.1 not 1.2.0
The proposed workaround for alpine does not work anymore, as install.goreleaser.com
has been removed as of 2022-05-18
https://goreleaser.com/deprecations/#godownloader
This worked fine for me :
FROM node:14-alpine as builder
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# Install node-prune
RUN wget -qO- https://gobinaries.com/tj/node-prune | ash -s
# ...
FYI, setting /bin/ash -eo pipefail
allows RUN to detect if a command fails in a pipe chain. Otherwise it only fails if the last piped command fails.
This worked for me:
FROM node:19-alpine as builder
RUN mkdir /app
WORKDIR /app
# node-prune
RUN wget -qO- https://gobinaries.com/tj/node-prune | sh
ENV NODE_ENV production
COPY . .
RUN npm install
...
I would like to run on alpine image of Docker by installing via gobinaries.com, but I got error message below:
I think installation is complete, but the executable is not suitable for alpine environment. Is it possible for you to support this using GoReleaser?
reproduction