Issues deploying Hortonworks HDP with docker/podman

I was trying to install Hortonworks HDP , using the docker version with this guide. I did

alias docker = podman

and ran the script

 sh docker-deploy-hdp30.sh

[chris@fedora HDP_3.0.1_docker-deploy-scripts_18120587fc7fb]$ sh docker-deploy-hdp30.sh 
+ registry=hortonworks
+ name=sandbox-hdp
+ version=3.0.1
+ proxyName=sandbox-proxy
+ proxyVersion=1.0
+ flavor=hdp
+ echo hdp
+ mkdir -p sandbox/proxy/conf.d
+ mkdir -p sandbox/proxy/conf.stream.d
+ docker pull hortonworks/sandbox-hdp:3.0.1
docker-deploy-hdp30.sh: line 23: docker: command not found
+ docker pull hortonworks/sandbox-proxy:1.0
docker-deploy-hdp30.sh: line 24: docker: command not found
+ '[' hdp == hdf ']'
+ '[' hdp == hdp ']'
+ hostname=sandbox-hdp.hortonworks.com
++ docker images
++ grep hortonworks/sandbox-hdp
docker-deploy-hdp30.sh: line 34: docker: command not found
++ awk '{print $2}'
+ version=
+ docker network create cda
+ docker run --privileged --name sandbox-hdp -h sandbox-hdp.hortonworks.com --network=cda --network-alias=sandbox-hdp.hortonworks.com -d hortonworks/sandbox-hdp:
docker-deploy-hdp30.sh: line 40: docker: command not found
+ echo ' Remove existing postgres run files. Please wait'
 Remove existing postgres run files. Please wait
+ sleep 2
+ docker exec -t sandbox-hdp sh -c 'rm -rf /var/run/postgresql/*; systemctl restart postgresql-9.6.service;'
docker-deploy-hdp30.sh: line 44: docker: command not found
+ sed s/sandbox-hdp-security/sandbox-hdp/g assets/generate-proxy-deploy-script.sh
+ mv -f assets/generate-proxy-deploy-script.sh.new assets/generate-proxy-deploy-script.sh
+ chmod +x assets/generate-proxy-deploy-script.sh
+ assets/generate-proxy-deploy-script.sh
+ uname
+ grep MINGW
+ chmod +x sandbox/proxy/proxy-deploy.sh
+ sandbox/proxy/proxy-deploy.sh
sandbox/proxy/proxy-deploy.sh: line 3: docker: command not found
[chris@fedora HDP_3.0.1_docker-deploy-scripts_18120587fc7fb]$ 


But , there is a problem too.
Any know if it is a simple problem or is a relevant issue?

docker-deploy-hdp30.sh , script:

#!/usr/bin/env sh
#This script downloads HDP sandbox along with their proxy docker container
set -x

# CAN EDIT THESE VALUES
registry="hortonworks"
name="sandbox-hdp"
version="3.0.1"
proxyName="sandbox-proxy"
proxyVersion="1.0"
flavor="hdp"

# NO EDITS BEYOND THIS LINE
# housekeeping
echo $flavor > sandbox-flavor


# create necessary folders for nginx and copy over our rule generation script there
mkdir -p sandbox/proxy/conf.d
mkdir -p sandbox/proxy/conf.stream.d

# pull and tag the sandbox and the proxy container
docker pull "$registry/$name:$version"
docker pull "$registry/$proxyName:$proxyVersion"


# start the docker container and proxy
if [ "$flavor" == "hdf" ]; then
 hostname="sandbox-hdf.hortonworks.com"
elif [ "$flavor" == "hdp" ]; then
 hostname="sandbox-hdp.hortonworks.com"
fi

version=$(docker images | grep $registry/$name  | awk '{print $2}');

# Create cda docker network
docker network create cda 2>/dev/null

# Deploy the sandbox into the cda docker network
docker run --privileged --name $name -h $hostname --network=cda --network-alias=$hostname -d "$registry/$name:$version"

echo " Remove existing postgres run files. Please wait"
sleep 2
docker exec -t "$name" sh -c "rm -rf /var/run/postgresql/*; systemctl restart postgresql-9.6.service;"


#Deploy the proxy container.
sed 's/sandbox-hdp-security/sandbox-hdp/g' assets/generate-proxy-deploy-script.sh > assets/generate-proxy-deploy-script.sh.new
mv -f assets/generate-proxy-deploy-script.sh.new assets/generate-proxy-deploy-script.sh
chmod +x assets/generate-proxy-deploy-script.sh
assets/generate-proxy-deploy-script.sh 2>/dev/null

#check to see if it's windows
if uname | grep MINGW; then 
 sed -i -e 's/\( \/[a-z]\)/\U\1:/g' sandbox/proxy/proxy-deploy.sh
fi
chmod +x sandbox/proxy/proxy-deploy.sh 2>/dev/null
sandbox/proxy/proxy-deploy.sh 
3 Likes
  1. Needs to be register cloudera to check/see the scripts and Webpage.
  2. could you please paste the script here
  3. It weird Did you close your terminal or restart your shell?
  4. Do this in your terminal → alias | grep docker

Regards.,

2 Likes

I wonder if this is the issue:

i.e., I’m not sure if aliases defined for one shell are passed on to “child” shells by default.

here’s a quick example:

$ alias haha="echo lol"
$ haha
lol
$ echo "haha" > test.sh
$ chmod +x test.sh
$ cat test.sh
haha
$ ./test.sh
./test.sh: line 1: haha: command not found
$ sh test.sh
test.sh: line 1: haha: command not found
2 Likes

Aliases are not expanded when the shell is not interactive, unless the expand_aliases shell option is set using shopt. I would consider using a function and export it instead of an alias in this case:

$ docker() { podman "$@"; }
$ export -f docker
2 Likes

Yes i was wondering that too.