Here are some of useful commands using Docker and DC/OS:

Docker commands:

#build
docker build -t appName .

#list images
docker images

#run
docker run -p hostPort:vmPort appName

#run in background (detached)
docker run -d -p hostPort:vmPort appName

#list processes
docker ps

#stop container
docker stop containerId

#docker hub
docker login
docker tag appName orgNamespace/repoName
docker push orgNamespace/repoName

#run from docker hub
docker run -p hostPort:vmPort orgNamespace/repoName

#dc/os deploy to public agent server:
#add this line to service json (with a comma before||after)
"acceptedResourceRoles": ["slave_public"]

#run command inside container and get output
docker exec -it containerId someCommand

#run 'sh' inside the container
docker exec -i containerId sh

#docker container runs a minimal Moby GNU/Linux 
#(kinda Debian, Ubuntu)

#spark app maven test
maven test

#spark app maven build jar
maven package

#spark app run
./bin/spark-submit --class some.package.App \
--master local[2] /some/path/somefile.jar \
argument1 argument2 argument3

#spark app run (dc/os)
dcos spark run --submit-args='-Dspark.mesos.coarse=true \
--driver-cores 1 --driver-memory 1024M \
--class some.package.App \
https://some.url/to/somefile.jar \
someArgument1 someArgument2'
Advertisements