An image which can be used in bitbucket pipeline or any other pipeline which supports linux based docker images. It is based off alpine with few run time and utility packages like .net core,ant,node/npm, grunt curl, Chrome and firefox web drivers for selenium web automation needs
- It gets alpine as base image (a lightweight distribution of linux) alpine with dotnet core sdk 2.2
- install bash (for scripting)
- jdk (to use ant library for salesforce deployment)
- jq (to parse json response in cli). JSON processor
- nodejs/npm (node runtime and package manager) node
- grunt-cli (cli for grunt task runner) gruntjs
- checking dotnet version (our image is based off a dotnet core image from microsoft so it comes pre-installed)
- chromium and chromium-chromedriver and firefox and geckodriver (to use it in selenium web automation project) selenium
- apache-ant (to deploy metadata to salesforce) ant
- curl (genral pupose sommnad line tool to transfer data eith URLS i.e. to make a POST using HTTP) curl
- and some other misc utility/supporting packages like xvfb, tar
following steps are tested on Mac only
Once installed let's test if docker works fine on your machine. To check, open your terminal and run following command
docker --version
Docker version 18.09.2, build 6247962
After installing we need to start docker application before moving forward. You can do this by Docker GUI or by starting it from cli. Following command is tested in Mac only:
open --background -a Docker
It will take a while to docker to start and be ready to take further commands
Now goto root of project folder and run following where ./Dockerfile is a path to the file which will be the definition of your image. sfappdockv1 is the name of the image.
docker build . -t sfappdockv1 -f ./Dockerfile
You might wanna make sure the Entrypoint in DockerFile is pointed to bash i.e. ENTRYPOINT ["/bin/bash"] to use bash so that you can interact with it using command line
docker run -it sfappdockv1
-it allow you to run docker in interactive mode
use the escape sequence Ctrl-p + Ctrl-q