...
- specify the starting docker image
- copy files into the image
- run commands in the image
- specify the internal ports that will be used by the image
- define the entrypoint (what gets executed at image startup)
Dockerfile
Code Block | ||
---|---|---|
| ||
FROM jamesdbloom/mockserver |
...
LABEL placodermi.component=mockserver |
...
WORKDIR /opt/mockserver |
...
# Artifacts COPY entrypoint.sh /opt/mockserver/entrypoint.sh |
...
COPY MockInitializer.java /opt/mockserver/MockInitializer.java |
...
RUN chmod +x /opt/mockserver/entrypoint.sh |
...
EXPOSE 1080 EXPOSE 1090 ENTRYPOINT ["/opt/mockserver/entrypoint.sh"] |
Build the Image
Run the Dockerfile by issuing the following command
...
That's the general basics of it all.
Creating a New Container in CloakedJS using Ansible
If you want to create a docker container in CloakedJS, have a look at the mockserver implementation in the following folders:
...
folder/file
...
Purpose
...
folder/file
...
Purpose
...
Define the building of the image. Folder structure:
...
Define the building of the container.
Folder structure:
...
Script to run the tasks mentioned above to build and deploy the docker image/container.
...