-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged all process in one single RUN to save image space and also remove node user. Can not be used with rpi-alpine-base due to just-containers/s6-overlay#207
- Loading branch information
Showing
2 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
FROM kafebob/rpi-alpine:3.6 | ||
FROM kafebob/rpi-alpine-base:3.6 | ||
MAINTAINER Luis Toubes <[email protected]> | ||
|
||
ENV NVM_VERSION=v0.33.2 NODE_VERSION=v8.2.1 PROFILE=/home/node/.bashrc | ||
ENV NVM_VERSION=v0.33.2 NODE_VERSION=v8.2.1 PROFILE=/root/.bashrc | ||
|
||
RUN apk add --update --no-cache curl bash \ | ||
ca-certificates openssl coreutils && \ | ||
apk add --update --no-cache --virtual build-dependencies ncurses python2 \ | ||
make gcc g++ libgcc linux-headers && \ | ||
addgroup -g 1000 node && \ | ||
adduser -u 1000 -G node -s /bin/bash -h /home/node -D node | ||
|
||
USER node | ||
RUN cd /home/node && \ | ||
cd /root && \ | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | bash && \ | ||
echo "#NVM Setup" >> $PROFILE && \ | ||
echo 'export NVM_DIR="$HOME/.nvm"' >> $PROFILE && \ | ||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> $PROFILE && \ | ||
source $PROFILE && \ | ||
nvm install -s $NODE_VERSION --fully-static && \ | ||
rm -rf /home/node/.nvm/.cache/src/node-$NODE_VERSION | ||
|
||
USER root | ||
RUN apk del build-dependencies && \ | ||
rm -rf /root/.nvm/.cache/src/node-$NODE_VERSION && \ | ||
apk del build-dependencies && \ | ||
rm -rf /tmp/* /var/cache/apk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Alpine Node Images | ||
|
||
## Node Image | ||
|
||
In order to build your own Node Image for your Raspberry Pi based on `gliderlabs/alpine` | ||
|
||
``` | ||
git clone https://github.com/xcafebabe/gobstoppers.git && \ | ||
cd gobstoppers/node && \ | ||
sudo docker build -t kafebob/rpi-alpine-node:latest . | ||
``` | ||
|
||
Be patient is going to take a while. | ||
|
||
By default is going to use as image name `kafebob/rpi-alpine-node` and as tag version `latest` | ||
|
||
You can change these names creating two environment variables | ||
|
||
``` | ||
export IMAGE_VERSION=8.2.1 && \ | ||
export IMAGE_NAME=kafebob/rpi-alpine-node | ||
``` | ||
|
||
If you just want to use latest image available, pull a copy from DockerHub | ||
|
||
``` | ||
sudo docker pull kafebob/rpi-alpine-node:latest | ||
``` |