#docker

/

      • kozy has quit
      • rapidshot64 joined the channel
      • milardovich has quit
      • chrisM_1 has quit
      • __Yiota joined the channel
      • Spec joined the channel
      • gentunian joined the channel
      • iNs joined the channel
      • bdonnahue joined the channel
      • LennardW|afk joined the channel
      • gentunian has quit
      • lorddaed_ has quit
      • lorddaedra joined the channel
      • KermitoniT joined the channel
      • kingarmadillo has quit
      • gentunian joined the channel
      • saschpe has quit
      • kingarmadillo joined the channel
      • redaudit joined the channel
      • saschpe joined the channel
      • scottyc joined the channel
      • boombatower joined the channel
      • donghao joined the channel
      • petipetipeti has quit
      • jameser joined the channel
      • donghao has quit
      • tmsmith has quit
      • LennardW|afk joined the channel
      • cyborg-one joined the channel
      • serafincpd has quit
      • scottyc joined the channel
      • Mony joined the channel
      • Bock joined the channel
      • Bock has quit
      • livingstn joined the channel
      • AtumT has quit
      • Bock joined the channel
      • Sasazuka joined the channel
      • Sasazuka has quit
      • gentunian has quit
      • Masterph_ has quit
      • cads joined the channel
      • jane_booty_doe joined the channel
      • OskrGrme joined the channel
      • svm_invictvs joined the channel
      • moepot has quit
      • pmercado_ joined the channel
      • saschpe has quit
      • Mony has quit
      • saschpe joined the channel
      • Mony joined the channel
      • pmercado has quit
      • OskrGrme joined the channel
      • slide
        So I have a swarm with 1 stack that has 2 services. The manager says that each service has 1/1 replicates, but on the worker node i see 2 processes for each service.
      • docker service ps SERVICE tells me 2 are shutdown even though they aren't
      • gentunian joined the channel
      • piklu
        What is the way to use database/storage in docker's architecture?
      • do u have one thick slice of db in one docker instance, or scale them in docker containers, how to manage storage than
      • beerdrop joined the channel
      • ash_guest joined the channel
      • ash_guest
        how do you start a service from your docker-compose.yml file running a particular command?
      • I tried `docker-compose run --rm node sh` but that doesn't seem to use the port mappings in the yml file
      • secondly I don't know why that wouldn't take /bin/sh correctly like docker exec does
      • I mean, I get an error when attempting `docker-compose run node /bin/sh`
      • agc93
        ash_guest: you would usually provide the command for the service in the `docker-compose.yml` file and then running `docker-compose up <service>` would run that command for you
      • ash_guest
        agc93: I know
      • raijin joined the channel
      • and I just realized why the port thing didn't work
      • agc93: this is a one-off btw
      • agc93
        oh, then just use docker exec/run as per normal?
      • ash_guest
        agc93: trying to learn node more efficiently
      • but the reason why `docker run node sh` doesn't map the ports is because: --service-ports Run command with the service's ports enabled and mapped to the host.
      • agc93: *AND* -v, --volume=[] Bind mount a volume (default [])
      • agc93: I mean, so much for storing the service definition in a yml file... it's nearly as much work just use `docker run`
      • okay, I take it back... `--service-ports` is shorter than `-p ... -p ... ...`
      • but still
      • disconnect3d has left the channel
      • I feel like that should be the default
      • agc93
        ash_guest: well Compose is not really intended for one-off scenarios
      • If you're doing much one-off, just use Docker normally (no need for Compose)
      • ash_guest
        agc93: the other thing that's really confusing to me is getting an error when I attempt `docker-compose run --rm node /bin/sh`
      • Nemaster joined the channel
      • agc93: in this scenario where I'm learning, I'd rather just keep adding things to a definition as I go, but whats the deal with that error? ^
      • agc93
        ash_guest: that command makes no sense, why would you want to rm a container you're managing with Compose?
      • cads has quit
      • ash_guest
        agc93: well, the --rm flag is allowable in docker-compose run
      • --rm Remove container after run. Ignored in detached mode.
      • agc93
        ash_guest: Yeah I know, just a bit odd
      • ash_guest: What's your use case?
      • ash_guest
        agc93: it's just because it's 99% likely I don't care about this container... it's for learning purposes
      • agc93
        Right, then why are you using Compose?
      • Pavo joined the channel
      • ash_guest
        agc93: because I don't want to be appending to a docker command in my history as I go
      • Pavo has quit
      • agc93: I'd rather keep the command the same throughout my history and just change the compose file
      • agc93
        "Compose is a tool for defining and running multi-container Docker applications."
      • ash_guest
        I'm working on windows so this is easier for me anyway
      • agc93
        You're going to run into a lot of problems doing that as that is really not what Compose is made for
      • You're better off doing that with a Bash script that you update
      • ash_guest
        ¯\_(ツ)_/¯
      • (interestingly, the expose expression works
      • )
      • agc93: any ideas on why I get: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"C:/Program Files/Git/usr/bin/sh\": stat C:/Program Files/Git/usr/bin/sh: no such file or directory" -- when I try /bin/sh with compose?
      • agc93
        What's the "node" service defined as?
      • svm_invictvs has quit
      • ash_guest
        agc93: image: node ... etc
      • agc93: `docker-compose run node sh` works though
      • agc93
        Well, what's wrong with using that command?
      • ash_guest
        agc93: nothing, but it's very odd
      • agc93: considering other commands use /bin/sh
      • agc93
        doesn't seem it to me
      • I just tried on my machine and that works fine
      • bdonnahue has quit
      • Might be your terminal expanding /bin/sh without you realising?
      • ash_guest
        agc93: tried what? and what's your host os?
      • svm_invictvs joined the channel
      • agc93
        Your scenario: Compose file with node service, running docker-compose run --rm node /bin/sh. But yeah, I'm on Linux. Clearly, you've got something funky happening on the Windows end judging by that error message
      • svm_invictvs has quit
      • ash_guest
        agc93: that'd be weird for it to expand for `docker-compose run node /bin/sh` and not `docker exec -it foo_node /bin/sh`
      • agc93
        ash_guest: I don't know, I don't work on Windows much, and I certainly don't use Compose for one-off/iterative work much
      • ash_guest
        agc93: thanks for humoring my situation btw
      • :)
      • agc93
        after you `docker-compose up`, what happens if you exec into the running container rather than using `run`?
      • svm_invictvs joined the channel
      • Ninetou has quit
      • ash_guest
        agc93: I haven't gotten so far that I'm running something persistently using just compose
      • agc93: still learning node; almost there though... though I'm sure this is not the most "correct" way to run node
      • agc93
        Oh well, I know I sound like a broken record, but yeah you *definitely* shouldn't be using Compose for that haha
      • Yeah, if you're only learning node now, you might be better off just learning Node first, then adding Docker to the mix later on
      • ash_guest
        agc93: yeah, but when that's done, it's more in line with compose's typical usage
      • agc93
        I (personally) find it easier to write app -> run in container -> run in Compose
      • and makes it easier to debug problems
      • ash_guest
        agc93: I've added node to windows before and wanted to shoot myself. I am convinced just from that that I am going to containerize everything
      • agc93
        Are you on Windows 10?
      • ash_guest
        agc93: that's what I'm doing
      • agc93: I don't really have the dominion over this computer to just install things willy-nilly anyway
      • agc93
        Yeah containerising everything is fair enough, but do so just using Docker on it's own to start with, then add Compose later is what I'm trying to suggest
      • Regardless, if you're doing Node dev on Windows 10, just install Bash on Ubuntu on Windows and be done with it; it's much better to work with
      • ash_guest
        ¯\_(ツ)_/¯ .... I have pleasant experience with docker-compose (esp on Linux) but I'm swimming in foreign waters as far as windows is concerned
      • agc93: I don't want to rely on ubuntu; unfortunately, although I feel fairly apt at ubuntu, it might as well be a garden maze when it comes to alpine-linux which is what I intend to run everything on
      • agc93: I was tearing my hair out just understanding ssh on alpine-linux
      • agc93
        Yeah I find `docker run node <do-what-you-gotta-do>` much easier to work with then wading through Compose files while I'm developing (personally).
      • As for Ubuntu, you don't build for it, just use it as your Node environment for Windows
      • ash_guest
        agc93: I don't know as if I follow your suggestion
      • -as
      • agc93
        which one?
      • ash_guest
        your last one
      • btw, I got it working
      • "working"
      • still don't know about that error but I feel like, w/e move on