linux - How to deploy a self-building Docker image to make changes to itself in respect to the local environment? -
as quick recap, docker serves way write code or configuration file changes specific web service, run environment, virtual machines, cozy confines of linux terminal/text file. docker images save points of layers of code made either dockerfiles or can created containers require base image go off of anyways create. dockerfiles serve way automate build process of making images running desired commands , actions new containers spawned , roll them 1 file.
now great , want take step further. building images, dependencies encumbersome because 1,you have rely on commands either not there within default os image, or 2, have lot of other useless commands not needed.
now in head feel possible cant make connection yet. my desire dockerfile build scratch (litterally image of scratch) and build according. copy dependencies desired rpm or something, install it, find start command, , relay dependencies thats needed succesfully create , run image no flaw docker file. in programming sense,
from scratch copy package.rpm run *desired cmds*
run errors fed file. file searchs current os dependencies needed , returns them run cmd.
cmd *service start up*
as cmd, run service, , status , filter startup commands cmd portion.
the problem here though dont believe can use docker these ends. docker build of something, retain errors , filter build again seems challenging. wish docker come equipped seem chance of performing such task through script wreaks havoc on portability factor.
any ideas?
docker isn't going offer painless builds. docker doesn't know want.
you have several options here:
kitematic osx https://kitematic.com/ (they have alpha release windows here https://github.com/kitematic/kitematic/releases). use application download containers others have put work in gui interface.
docker compose. docker compose lets use yaml configuration files boot docker containers. if see examples of view repo: https://github.com/b00gizm/docker-compose-nodejs-examples
a simple example:
web: build: . volumes: - "app:/src/app" ports: - "3030:3000"
to use it:
docker-compose up
docker compose then:
- call container
web
- build using current working directory root
- mount
app
directory/src/app
in container - expose container port 3030 3000 outside world.
note build
can point docker container found via kitematic (which reads registry.hub.docker.com) can replace .
(in example above on build line) node:latest
, build nodejs container.
docker compose similar docker command line. can use https://lorry.io/ generating docker-compose.yml files.
- if you're looking epic solution, recommend mesosphere enterprise docker environment.
there other solutions google's kubernetes , apache mesos, learning curve increase.
i noticed mucking ip's , while haven't used it, hear, weave simplifies network aspect of docker, not docker's strong suit.
Comments
Post a Comment