Source: https://gitlab.com/agrozyme-docker/alpine
Alpine Base Image
root usercore userDOCKER_CORE_UID / DOCKER_CORE_GID
500500docker_core to call update_user to change UID / GID of core
using the environment variable DOCKER_CORE_UID / DOCKER_CORE_GIDsu-exec core to execute the serviceDockerfile example
FROM docker.io/library/alpine
RUN apk add --no-cache bash sudo ruby-rdoc ruby-bundler
COPY rootfs /
RUN sudo chmod +x /usr/local/bin/* \
# && gem install -N thor \
&& gem install -N docker_core \
&& /usr/local/bin/docker_build.rb
SHELL [ "/bin/bash", "-c" ]
ENTRYPOINT ["/sbin/tini-static", "--"]
CMD ["/bin/bash"]
require_relative("./image/#{module}") to other scripts (ex: docker_build.rb / docker_run.rb)docker build scriptRUN chmod +x /usr/local/bin/* && gem update -N docker_core && gem clean && /usr/local/bin/docker_build.rb
to DockerfileExample
#! /usr/bin/ruby
def main
print(`apk add --no-cache su-exec tini-static busybox-suid`)
end
main
docker run scriptCMD ["/usr/local/bin/docker_run.rb"] to DockerfileExample
#! /usr/bin/ruby
def main
exec('/bin/bash')
end
main
docker run -it --rm {image} {command} to execute the command/home/core/deploy
|-- profile.sh
|-- runner.rb
|-- <core>
|-- <volume>
|-- <stack>
|-- docker-compose.yml
|-- [setup.sh]
|-- [*.env]
/home/core/deploy
|-- profile.sh
|-- runner.rb
|-- <core>
|-- <volume>
|-- <stack>
|-- kustomization.yml
|-- volume.yml
|-- issuer.yml
|-- deployment.yml
|-- [setup.sh]
|-- [*.env]
core user does not exist in the host OS, create onecore user to 500host folder need to be placed in the /home/core/deploy directorydocker_core gemdeploy folder to /home/core/deploy in host OS or VMupdate_core: update gem docker_coreupdate_alias: update aliasupdate_swarm [orchestrator]: update default orchestratorswarm_run: run commandswarm_status: show swarm service statusswarm_setup: setup the swarmswarm_leave: clean everything up and leave the swarmstack_deploy: delpoy stackstack_remove: remove stack and containersContent type
Image
Digest
sha256:1e1d5b630…
Size
18.6 MB
Last updated
about 1 month ago
docker pull agrozyme/alpine