Following are the key points described later in this article:
Following code can be used to create NodeJS/NPM image.
# Use base image of centos6
FROM centos:centos6
# Enable Extra Packages for Enterprise Linux (EPEL) for CentOS
RUN yum install -y epel-release
# Install Node.js and npm
RUN yum install -y nodejs npm
Place the code in a file and name it as nodejs_base.df. The above code could be used to build the nodejs image using following command:
docker build -t nodejs_base -f nodejs_base.df .
Following code assumes that above image is built with tag “nodejs_base”.
FROM nodejs_base
RUN npm install -g typescript
Place the code in a file and name it as typescript.df. The above code could be used to build the typescript image using following command:
docker build -t typescript -f typescript.df .
Once the “typescript” image is built, one could create the container where typescript files could be compiled. Following command could be used to build the typescript container.
docker run -ti -dP --name ts1 -v /c/Users:/mnt/Users typescript /bin/bash
Type “tsc –help” command and it should print the information in relation with tsc and different options.
Following script could be used to create Typescript container.
#!/bin/sh
if [ $# == 0 ]; then
echo "This script expect container name argument. Example: ./installTS.sh ts1"
exit 100
fi
# Build NodeJS image if it does not exists
#
nb_image="nodejs_base"
nb_df="nodejs_base.df"
if [ `docker images $nb_image | wc -l` -lt 2 ]; then
echo "Docker Image $nb_image do not exist..."
echo "Builing docker image $nb_image"
if [ -f $nb_df ]; then
docker build -t $nb_image -f $nb_df .
else
echo "Can't find Dockerfile $nb_df in the current location"
exit 200
fi
fi
# Build Typescript image if it does not exists
#
ts_image="typescript"
ts_df="typescript.df"
if [ `docker images $ts_image | wc -l` -lt 2 ]; then
echo "Docker Image $ts_image do not exist..."
echo "Builing docker image $ts_image"
if [ -f $ts_df ]; then
docker build -t $ts_image -f $ts_df .
else
echo "Can't find Dockerfile $ts_df in the current location"
exit 200
fi
fi
docker run --privileged=true -ti -dP --name $1 -v /c/Users:/mnt/Users $ts_image /bin/bash
Last updated: 1st May, 2024 The bias-variance trade-off is a fundamental concept in machine learning…
Last updated: 1st May, 2024 As a data scientist, understanding the nuances of various cost…
Last updated: 1st May, 2024 In this post, you will learn the concepts related to…
Last updated: 26th April, 2024 In this blog post, we will discuss the logistic regression…
Last updated: 22nd April, 2024 As data scientists, we navigate a sea of metrics to…
Last updated: 22nd April, 2024 This post will teach you about the gradient descent algorithm…