You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Issue proposes two distinct improvements to the Docker image:
Change from CMD to ENTRYPOINT:
This modification shifts the container's main executable specification from the CMD directive to ENTRYPOINT. The primary advantage of this is the encapsulation of the executable within the image, which simplifies the command needed to run the container. Instead of having to specify the executable each time, like so: docker run staketechnologies/astar-collator:latest astar-collator --chain astar
Users can now simply pass the necessary arguments directly, as the ENTRYPOINT specifies the executable: docker run staketechnologies/astar-collator:latest --chain astar
This change is particularly beneficial for Kubernetes deployments, where the ENTRYPOINT of a Docker image typically specifies the starting command.
Retention of the shell (/bin/sh):
The Docker image previously had steps to remove /usr/bin and /usr/sbin, which included the shell. The Helm chart by Parity Tech relies on the shell within the container to execute a sequence of operations. For instance, the persist-generated-node-key init container script uses /bin/sh to perform actions such as generating a node key if it doesn't already exist:
- name: persist-generated-node-key
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
command: [ "/bin/sh" ]
args:
- -c
- |set -eu {{ if .Values.initContainers.persistGeneratedNodeKey.debug }}-x{{ end }}
...
# Script continues to check and generate the node key
Maintaining the shell in the image ensures compatibility with these scripts and prevents the failure of Helm chart operations that depend on shell access within the container.
The Issue's intent is to provide a Docker image that not only maintains backward compatibility but also enhances the image's usability within Kubernetes environments, especially when managed via Helm charts.
The Issue proposes two distinct improvements to the Docker image:
CMD
toENTRYPOINT
:This modification shifts the container's main executable specification from the
CMD
directive toENTRYPOINT
. The primary advantage of this is the encapsulation of the executable within the image, which simplifies the command needed to run the container. Instead of having to specify the executable each time, like so:docker run staketechnologies/astar-collator:latest astar-collator --chain astar
Users can now simply pass the necessary arguments directly, as the
ENTRYPOINT
specifies the executable:docker run staketechnologies/astar-collator:latest --chain astar
This change is particularly beneficial for Kubernetes deployments, where the
ENTRYPOINT
of a Docker image typically specifies the starting command./bin/sh
):The Docker image previously had steps to remove
/usr/bin
and/usr/sbin
, which included the shell. The Helm chart by Parity Tech relies on the shell within the container to execute a sequence of operations. For instance, the persist-generated-node-key init container script uses/bin/sh
to perform actions such as generating a node key if it doesn't already exist:Maintaining the shell in the image ensures compatibility with these scripts and prevents the failure of Helm chart operations that depend on shell access within the container.
The Issue's intent is to provide a Docker image that not only maintains backward compatibility but also enhances the image's usability within Kubernetes environments, especially when managed via Helm charts.
An example of our current usage in k8s:
The text was updated successfully, but these errors were encountered: