-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Client DockerFiles for Linux minor refactoring and hierarchical…
… changes.
- Loading branch information
1 parent
b4cdc76
commit 71d5dbe
Showing
8 changed files
with
163 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Setting base image for NCache. | ||
FROM microsoft/dotnet:2.1-runtime | ||
|
||
# Setting the enviornment variable so the NCache install script knows that it's running inside a container. | ||
ENV container ncachedocker | ||
|
||
# Setting work directory to copy setups and resources for configuring NCache. | ||
WORKDIR /app | ||
|
||
# Make sure that the 2 folders ("resources" and "setup") exist in the same directory as the Dockerfile. | ||
# Make sure that "ipbinding.sh" script resides in the "resources" folder. | ||
# Make sure that "startup.sh" script resides in the "resources" folder. | ||
# Make sure that "installncache.sh" script resides in the "setup" folder. | ||
# Make sure that NCache Linux setup (.tar.gz) resides in the "setup" folder. It can be downloaded from http://www.alachisoft.com/download-ncache.html. | ||
# Copying resources and setups into the work directory of the container. | ||
COPY resources . | ||
COPY setup . | ||
|
||
# Exposing ports used by NCache for communication. | ||
# Exposing the port at which Ncache service will listen for the incoming client connection requests. | ||
EXPOSE 9800 | ||
|
||
# Exposing the port at which Ncache service will listen for the incoming management connection requests (NCache Manager, Monitor and Tools). | ||
EXPOSE 8250 | ||
|
||
# Make sure your machine has access to internet for installation of packages. | ||
# Installing package procps (Prerequisite of NCache services). | ||
RUN apt-get update &&\ | ||
apt-get install procps -y | ||
|
||
# Installing NCache Linux setup (.tar.gz). | ||
# The parameter "--evalkey" is the install key and is sent to user through e-mail once they download NCache setup. In case if user does not get a key, contact us at http://www.alachisoft.com/company/contact-us.html. | ||
# The parameter "--firstname" represents the first name of the user. | ||
# The parameter "--lastname" represents the last name of the user. | ||
# The parameter "--email" represents the e-mail address of the user. | ||
# The parameter "--installpath" represents the path where ncache will be installed. If not provided then /opt/ncache will be used. | ||
# The parameter "--force" Force create destination directory if provided directory does not exist. | ||
# The parameter "--password" represents the password for user ncache. | ||
# The parameter "--installmode" represents the NCache installation mode and has the following values: | ||
# Enterprise Server Install mode = "0" | ||
# Enterprise Remote Client Install mode = "3" | ||
RUN chmod +x installncache.sh &&\ | ||
./installncache.sh --installmode "3" --firstname "John" --lastname "Smith" --email "john@alachisoft.com" --installpath "/opt" --force --password "xxxxxxxx" | ||
|
||
# Currently, the IP during NCache installation is stored in the configuration files and it can not be made static at that point. | ||
# However, the IP can be made static once the container is started. | ||
# The startup script calls ipbinding.sh which replaces the IP with the actual IP assigned to the container on the first time the container is started. | ||
# Furthermore the startup.sh script starts ncached daemon service. | ||
# Making startup.sh executable. | ||
RUN chmod +x /app/startup.sh | ||
|
||
# Entry point for the container, once all the required configurations have been made. | ||
ENTRYPOINT /app/startup.sh && bash |
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,15 @@ | ||
#!/bin/sh | ||
|
||
ip="$(hostname -i)" | ||
DESTINATION=<DESTINATION> | ||
|
||
cd $DESTINATION/ncache/bin/service | ||
|
||
sed -i "s/<IP>/$ip/g" "Alachisoft.NCache.Daemon.dll.config" | ||
|
||
cd $DESTINATION/ncache/config | ||
|
||
sed -i "s/<IP>/$ip/g" "client.ncconf" | ||
sed -i "s/<IP>/$ip/g" "config.ncconf" | ||
|
||
rm -f /app/ipbinding.sh |
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,9 @@ | ||
#!/bin/sh | ||
|
||
if [ -e /app/ipbinding.sh ] | ||
then | ||
chmod +x /app/ipbinding.sh | ||
/app/ipbinding.sh | ||
fi | ||
|
||
service ncached start |
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,83 @@ | ||
#!/bin/sh | ||
while [ "$1" != "" ]; do | ||
case $1 in | ||
-d | --dotnethome ) shift | ||
DOTNETHOME=$1 | ||
;; | ||
|
||
-i | --ipaddress ) shift | ||
IP=$1 | ||
;; | ||
|
||
-p | --installpath ) shift | ||
DESTINATION=$1 | ||
;; | ||
|
||
-f | --firstname ) shift | ||
FIRST_NAME=$1 | ||
;; | ||
|
||
-l | --lastname ) shift | ||
LAST_NAME=$1 | ||
;; | ||
|
||
-e | --email ) shift | ||
EMAIL=$1 | ||
;; | ||
|
||
-k | --evalkey ) shift | ||
KEY=$1 | ||
;; | ||
|
||
-m | --installmode ) shift | ||
INSTALLMODE=$1 | ||
;; | ||
|
||
-P | --password ) shift | ||
PASSWORD=$1 | ||
NEWPASS="true" | ||
;; | ||
|
||
-F | --force ) | ||
FORCE="true" | ||
;; | ||
|
||
-v | --verbose ) | ||
VERBOSE="true" | ||
;; | ||
|
||
-h | --help ) | ||
usage | ||
exit | ||
;; | ||
* ) | ||
usage | ||
exit 1 | ||
esac | ||
shift | ||
done | ||
|
||
|
||
if [ -z $DESTINATION ] | ||
then | ||
DESTINATION="/opt" | ||
fi | ||
|
||
if [ -z $PASSWORD ] | ||
then | ||
PASSWORD="ncache" | ||
fi | ||
|
||
# Setting ncache install directory | ||
sed -i "s|<DESTINATION>|$DESTINATION|g" "/app/ipbinding.sh" | ||
|
||
# Extracting and installing NCache | ||
tar -zxf ncache.ent.netcore.tar.gz | ||
cd ncache-enterprise-4.9-dotnet | ||
|
||
./install --installmode $INSTALLMODE --firstname $FIRST_NAME --lastname $LAST_NAME --email $EMAIL --installpath $DESTINATION --force --password $PASSWORD | ||
|
||
# Removing installation resources | ||
rm /app/ncache.ent.netcore.tar.gz | ||
rm -r /app/ncache-enterprise-4.9-dotnet | ||
rm -f /app/installncache.sh |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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