- Dockerfile for Alpine base image w/ RSpec.
- Python script for repo cloning
- A little directory w/ a spec file and a supporting file to run a Helloworld Rspec test
- Open the MINGW64 shell from the UI of Docker Kinematic
- Navigate to whatever directory containing your build files
- Type the following:
docker build -t username/myimage .
(username must be correct; image name doesn't matter)
- This will compile your new image based on the Docker.file and other required files within that directory.
- This image will be available locally, but hasn't yet been pushed to Docker Hub
- Type
docker images
to see all the available images on your local machine - Type
docker ps
to see all the containers currently running on your local machine - Go ahead and launch your container using the following command:
docker run --name test-run -p 4000:80 -i -t username/myimage /bin/ash
- This is drop you into a bash session on your newly-started container
- The
-p
is for mapping your machine’s port 4000 to the container’s exposed port 80 for HTTP - To get out, type
exit
. - To get back in, go back to your Kinematic application and click on 'Exec' for that container and type
su
- Type
docker stop {CONTAINER ID}
if you ever to stop the container (find CONTAINER ID viadocker ps
) - Type
export BASE_URL="{https://yourGitHubUsername:thepersonalaccesstokenyougenerated@github.com/yourOrgName/RepoName.git}"
- This sets the BASE_URL that is consumed by your python script for repo cloning.
- Type
cd ..
cd usr/src/pythonScript
python clone.py
- On your shell, type
docker login
- Enter your username and password as prompted.
- Type
docker tag my_image username/my_image
- Type
docker push username/my_image
- create/run Docker image w/ Alpine & RSpec
- clone private Repo onto container
- execute basic local RSpec test successfully
- execute basic RSpec test successfully using HTTP
- configure container to talk HTTP to microservices
- excute all tests in repo
- integrate w/ CircleCI