https://dev.to/kcdchennai/apt-update-vs-apt-upgrade-whats-the-difference-2ff8

On building a docker image you may want to have some variables (you can also have them in docker-compose)
you can define ARG in docker file (you can also set default value for them in docker file)
for example :
# in docker file
ARG some_variable_name = xxxx
ARG uid
#on building image :
$ docker build --build-arg some_variable_name=a_value
ENV variables are also available during the build, as soon as you introduce them with an ENV instruction. However, unlike ARG, they are also accessible by containers started from the final image. ENV values can be overridden when starting a container, more on that below.
# no default value
ENV hey
# a default value
ENV foo /bar
# or ENV foo=/bar
# ENV values can be used during the build
ADD . $foo
# or ADD . ${foo}
# translates to: ADD . /bar
on running docker :
$ docker run -e "env_var_name=another_value" alpine env
for example :
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
COPY and ADD are both Dockerfile instructions that serve a similar purpose. They let you copy files from a specific location into a Docker image.
ADD does that same but in addition, it also supports 2 other sources.
COPY takes in a source and destination. It only lets you copy in a local or directory from your host (the machine-building the Docker image) into the Docker image itself.
for example :
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
for example:
# Set working directory
WORKDIR /var/www
for example:
USER $user
The article in the link below helps in this way.
Check it out.
https://maj0rmil4d.medium.com/how-to-run-our-own-smart-dns-to-bypass-geo-restrictions-beeeab4f82d7
ls -l example.txt
#output
-rw-r--r-- 12 linuxize users 12.0K Apr 8 20:51 example.txt
|[-][-][-]- [------] [---]
| | | | | | |
| | | | | | +-----------> 7. Group
| | | | | +-------------------> 6. Owner
| | | | +--------------------------> 5. Alternate Access Method
| | | +----------------------------> 4. Others Permissions
| | +-------------------------------> 3. Group Permissions
| +----------------------------------> 2. Owner Permissions
+------------------------------------> 1. File Type
in UNIX OSes, chmod is a command to change files and directories permissions.
chmod stands for “change mode”.
one of the most important reasons for Linux to be on the list of safe OSes is that every user has their own permission for each file and folder.
Most web applications are implemented based on Rest Full APIs and as I researched huge part of them are not implemented based on best practices and clean code principles, so I decided to collect some points in a couple of posts to help make them more efficient APIs and Applications.
you can easily research and find out more about all of these kine of API design methodologies but here I’m going to just collect best part of them to create a document to implement Rest API in best practice.
the best part of graphql is that you can design your API for the front end to just get whatever need, not more.
it can bring us better speed because less amount of packets is transferring over the network.
If you are a developer and you are going to start working with docker, and you already don’t know even the concepts of Docker, this article series is for you.
It was a little confusing for me when I started working with docker, so I decided to publish some articles for bits of help who are beginners to Docker or who want to review the concepts.
Docker allows users to build independent and isolated development environments in the computer and run their software in a way that we call Container. For example, suppose you need a project with php8.1, but you only have php7.4 on your system(you need the php7.4 version to develop other projects).
In this use case, you can build a docker image that contains your PHP suitable version and your database and other environments and run it as a container by the side of another project in an isolated environment.
You are running a Linux environment with different PHP, database, composer, node.js, npm, and…
And your teammate is working on mac os with a completely different environment .
What is the solution?
How can you work on the same project simultaneously in a different environment?
How to deploy a project if the server can’t provide project requirements based on our development environment?