Last active
February 20, 2023 12:38
Revisions
-
4mirul renamed this gist
Feb 20, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
4mirul revised this gist
Feb 20, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
4mirul revised this gist
Aug 1, 2022 . No changes.There are no files selected for viewing
-
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ [link](https://www.fosstechnix.com/dockerfile-instructions/) ```txt #1: FROM – FROM in Dockerfile Instruction used to specify Docker Image Name and start the build process -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ [link](https://www.fosstechnix.com/dockerfile-instructions/) ```.md #1: FROM – FROM in Dockerfile Instruction used to specify Docker Image Name and start the build process -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ [link](https://www.fosstechnix.com/dockerfile-instructions/) ```md #1: FROM – FROM in Dockerfile Instruction used to specify Docker Image Name and start the build process -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ [link](https://www.fosstechnix.com/dockerfile-instructions/) ```.md #1: FROM – FROM in Dockerfile Instruction used to specify Docker Image Name and start the build process -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 250 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,253 @@ # Dockerfile Instructions with Examples [link](https://www.fosstechnix.com/dockerfile-instructions/) ```md #1: FROM – FROM in Dockerfile Instruction used to specify Docker Image Name and start the build process Example 1: #specify a Base Image FROM ubuntu:latest Example 2: #specify a Base Image FROM node:12 #2: MAINTAINER – MAINTAINER in Dockerfile Instruction is used to about the person who creates the Docker Image Example: MAINTAINER support@fosstechnix.com #3: CMD – CMD in Dockerfile Instruction is used to execute a command in Running container, There should be one CMD in a Dockerfile. CMD executes the commands when your Docker Image is deployed. Example 1: # To run apache2 in foreground CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"] Example 2: FROM ubuntu:latest CMD /bin/bash #4: RUN – RUN in Dockerfile Instruction is used to execute any commands on top of current Docker Image RUN executes the command when you are building Image. Example 1: FROM ubuntu:latest MAINTAINER support@fosstechnix.com RUN apt-get update RUN apt-get install -y apache2 If you want to run .sh(shell script) file inside Dockerfile COPY test.sh . RUN ./test.sh #OR RUN /path/to/test.sh #5: LABEL – LABEL in Dockerfile Instruction is used to specify metadata information of Docker Image. Example: FROM ubuntu:latest LABEL "author"="FOSS TechNIx" LABEL "Date"="2020-09-29" #6: EXPOSE – EXPOSE in Dockerfile Instruction is used to specify Network port for Docker container Example 1: # To Expose port 80 of Docker container EXPOSE 80 Example 2: EXPOSE 8080/tcp #7: ENV – ENV in Dockerfile Instruction is used to set Environment Variables with key and value. Example 1: FROM node:12 ENV workdirectory /usr/node #8: ADD – ADD: Copies a file and directory from your host to Docker image, however can also fetch remote URLs, extract TAR/ZIP files, etc. It is used downloading remote resources, extracting TAR/ZIP files. Syntax: ADD <source>... <destination> Example 1: ADD java/jdk-8u231-linux-x64.tar /opt/jdk/ Example 2: ADD https://fosstechnix.com/test.tar.xz /home/ubuntu/test/ #9: COPY – COPY in Dockerfile Instruction used to Copies a file or directory from your host to Docker image, It is used to simply copying files or directories into the build context. Syntax: COPY <source>... <destination> Example 1: # To Install All dependencies for Node.js App COPY package\*.json ./ RUN npm install # To copy all application packages COPY . . Example 2: COPY index.html /var/www/html #10: ENTRYPOINT – ENTRYPOINT in Dockerfile Instruction is used you to configure a container that you can run as an executable. ENTRYPOINT specifies a commands that will executes when the Docker container starts. Example 1: FROM ubuntu:latest ENTRYPOINT ["ls"] #11: VOLUME – VOLUME in Dockerfile Instruction is used to create or mount volume to docker container. Example 1: FROM node:12 RUN mkdir /node WORKDIR /node RUN echo "Welcome to Node.js" > node VOLUME /node #12: USER – USER in Dockerfile Instruction is used to set the user name and UID when running container Example 1: USER admin To create new user in Dockerfile and login to user. Example 2: RUN adduser -D admin USER admin #13: WORKDIR – WORKDIR in Dockerfile Instruction is used to set the working directory. Example 1: # To Create nodejsapp directory WORKDIR /nodejsapp #14: ARG – ARG in Dockerfile Instruction is used to set Environment variables with key and value during the image build . Example 1: ARG JAVA_PATH=/opt/jdk/jdk1.8.0_251 ENV JAVA_HOME ${JAVA_PATH} #15: ONBUILD – ONBUILD in Dockerfile Instruction is used to specify command that runs when the image in Dockerfile is used as base image for another image. Examples 1: FROM node:12 RUN mkdir -p /usr/node/app WORKDIR /usr/node/app ONBUILD COPY package.json /usr/node/app/ ONBUILD RUN npm install ONBUILD COPY . /usr/node/app CMD [ "npm", "start" ] #16: STOPSIGNAL – STOPSIGNAL in Dockerfile Instruction is used to set the system call signal that will be sent to the container to exit Example 1: STOPSIGNAL SIGQUIT #17: SHELL – SHELL in Dockerfile Instruction is used to set the default shell. Example: SHELL ["/bin/bash", "-c", "echo hello"] #18: HEALTHCHECK – HEALTHCHECK in Dockerfile Instruction is used to Check container health by running a command inside the container Example 1: FROM ubuntu:latest HEALTHCHECK --interval=60s --timeout=5s \ CMD curl -f http://fosstechnix.info/ || exit 1 EXPOSE 80 #19: .dockerignore – .dockerignore in Dockerfile Instruction is used to prevent copy local modules and other unwanted file being copied into Docker Image. Create a .dockerignore in same directory and you can add unwanted modules/files into it. sudo nano .dockerignore \*.yaml **pycache**/ .git .aws .env ``` -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ # Dockerfile example [link](https://www.fosstechnix.com/dockerfile-instructions/) -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ # Dockerfile Instructions with Examples [link](https://www.fosstechnix.com/dockerfile-instructions/) -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ # Dockerfile Instructions with Examples -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
4mirul revised this gist
Aug 1, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
4mirul revised this gist
Jun 11, 2022 . No changes.There are no files selected for viewing
-
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -136,7 +136,7 @@ spec: --- ## Labels labels goes under `metadata:`. simple list of `key: value` for identifying. -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ --- ## cert-manager --- -
4mirul revised this gist
Jun 11, 2022 . No changes.There are no files selected for viewing
-
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -149,8 +149,7 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. - telling services and deploymens which pods are their - use label selectors to "link" resource dependencies - user labels and selectors to control which pods go to which nodes - selectors goes under `selector:` --- -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -150,6 +150,8 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. - use label selectors to "link" resource dependencies - user labels and selectors to control which pods go to which nodes selectors goes under `selector:` --- ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -148,6 +148,7 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. - telling services and deploymens which pods are their - use label selectors to "link" resource dependencies - user labels and selectors to control which pods go to which nodes --- -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -147,7 +147,9 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. ### Label Selectores - telling services and deploymens which pods are their - use label selectors to "link" resource dependencies --- ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -147,10 +147,7 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. ### Label Selectores - telling services and deploymens which pods are their - *** ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -144,6 +144,12 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. `kubectl apply -f <yaml-files> -l <key>=<value>` - apply only matching labels ### Label Selectores - telling services and deploymens which pods are their - --- ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -142,7 +142,9 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. `kubectl get pods -l <key>=<value>` - find pods with this label `kubectl apply -f <yaml-files> -l <key>=<value>` - apply only matching labels --- ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -142,7 +142,7 @@ labels goes under `metadata:`. simple list of `key: value` for identifying. `kubectl get pods -l <key>=<value>` - find pods with this label ## `kubectl apply -f <yaml-files> -l <key>=<value>` - apply only matching labels ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -136,10 +136,12 @@ spec: --- ### Labels labels goes under `metadata:`. simple list of `key: value` for identifying. `kubectl get pods -l <key>=<value>` - find pods with this label --- ## microk8s -
4mirul revised this gist
Jun 11, 2022 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -134,6 +134,14 @@ spec: `helm` - [link](https://helm.sh/) k8s package manager --- ### Label labels goes under `metadata:`. simple list of `key: value` for identifying. --- ## microk8s [link](https://microk8s.io/) -
4mirul revised this gist
Jun 10, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,7 +61,7 @@ `kubectl explain <kind>.<key>` - get the key details for that kind `kubectl explain <kind>.<key>.<key>` - get the specific key detail for that key for that kind ```yaml apiVersion: v1 -
4mirul revised this gist
Jun 10, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -59,9 +59,9 @@ `kubectl explain <kind> --recursive` - get all the keys each that specific kind supports `kubectl explain <kind>.<key>` - get the key details for that kind `kubectl explain <kind>.<key>.<key>` - get the specific key detail for that kind ```yaml apiVersion: v1
NewerOlder