#docker

/

      • notdaniel has quit
      • programmerq
        Agro▸ compose for repeatability and ease of container lifecycle
      • Agro
        awesome, thanks
      • buzzLightBeer joined the channel
      • buzzLightBeer
        what are use cases that require specifying a volume in a dockerfile?
      • and i don’t mean in a RUN directive, but the actual VOLUME directive
      • it seems the volume mapping override needs to be specified when docker run gets called anyway
      • publio has quit
      • programmerq
        buzzLightBeer▸ if I'm preparing an image that others will consume, a VOLUME will guarantee that place will be a volume. This is useful for a case like /var/lib/mysql where the mysql data dir *should not* be in the container's write layer.
      • the official mysql image has VOLUME /var/lib/mysql for this reason.
      • buzzLightBeer
        hrm
      • that prevents other images based on yours from using that path, like?
      • programmerq
        when you're taking care of both build and run in tandem, it does seem a bit silly and redundant, but image builder and image user are actually two personas in the docker workflow user story.
      • buzzLightBeer
        right?
      • programmerq
        yes
      • donghao joined the channel
      • buzzLightBeer
        i’ve seen that in action with the postgres image as well
      • programmerq
        yup
      • masuberu joined the channel
      • it's really all about having a way to say "this is where the stateful data will go"
      • buzzLightBeer
        my point exactly it seems more like a packaging feature than a configuration for runtime
      • programmerq
        and since stateful data goes in a volume, the VOLUME directive has a role to fill
      • yes absolutely-- runtime you'll still want to define where on the host that volume should be backed-- whether in the default anonymous volume, a named volume, or a host volume
      • but that's most certainly a runtime concern and not a buildtime concern.
      • buzzLightBeer
        good one
      • programmerq
        I need to make a short video explaining that-- it's a relatively common question.
      • buzzLightBeer
        oh you have a youtube channel?
      • programmerq
        no
      • :)
      • but I should
      • jaimie joined the channel
      • actually, if I were to do a video series like that, it'd probably end up on the
      • docker channel
      • buzzLightBeer
        it’s just not an obvious thing
      • programmerq
        but I haven't actually talked to the marketing team/my management team about all that idea
      • donghao has quit
      • buzzLightBeer
        i dont think it’s clear from the docs that’s the purpose of having that directive in the dockerfile
      • programmerq
        it depends on where you're coming from. since you, buzzLightBeer, are really acting as a combined persona "I want to package *and* run this software in a docker container", the feature for the non-combined persona isn't obvious.
      • buzzLightBeer
        so it’s like “it’s a feature. it’s there.”
      • but what do u really do with it
      • cuz there’s this other feature u can use that overrides it and you have to use that one anyway
      • DarkPsydeLord has quit
      • Milijus has quit
      • jaimie has quit
      • kim0 has quit
      • chachasmooth has quit
      • chachasmooth joined the channel
      • nckpz joined the channel
      • tmsmith has quit
      • chachasmooth has quit
      • piratepete joined the channel
      • Neotecha joined the channel
      • piratepete
        is anyone available to chat with me about an angular app and it's communications with a spring boot app within docker (networking)?
      • chachasmooth joined the channel
      • joshszep has quit
      • buzzLightBeer
        shoot
      • piratepete
        buzzLightBeer thanks for being here
      • buzzLightBeer
        don’t set the expectations so high buddy
      • piratepete
        I tried the rest app and node app separate using "localhost:8080" on my laptop but can't get past the CORs issue
      • sbock has quit
      • buzzLightBeer
        this is #docker
      • halprin has quit
      • whats your problem? :)
      • piratepete
        I now have the Spring Boot REST app running as a docker image on like 32894:8080 and that works. The angular app remains with it (monolith) and I've tested that. I want to create a node container with a server.js and the isolated angular in it's own container. I'm confused as to how I modify the resource urls in the angular app. It's not localhost:8080 or is it?
      • mischat joined the channel
      • halprin joined the channel
      • what host is the angular app supposed to call IP, name, port? to access the Spring Boot app. It's port config is 32892:8080 and my machine is 192.168.99.100. Is localhost:8080 still viable within docker?
      • poxbat joined the channel
      • buzzLightBeer
        no
      • programmerq
        each container has its own localhost. if you want containers to communicate with eachother, you should use network service discovery.
      • buzzLightBeer
        if your containers are on the same network you can reach them by their container names
      • if you specified the link argument when you called docker run
      • piratepete
        my angular app (within the monolith app) uses relative paths for the REST calls. I'll have to modify tons of code in the isolated version that will run in node server.
      • buzzLightBeer
        welcome to docker
      • :)
      • piratepete
        buzzLightBeer ahh, perfect!
      • so would a url be like "leonardo_decaprio/api"?
      • raijin has quit
      • buzzLightBeer
        uh i guess
      • if you’re using relative path
      • your container names can be used as hostnames
      • AllanEspinosa joined the channel
      • provided your containers are on the same network
      • and provided you link your containers
      • and while at it, read this too https://docs.docker.com/engine/reference/run/
      • piratepete
        buzzLightBeer thanks!
      • cyborg-one has quit
      • mischat has quit
      • programmerq
        piratepete▸ you shouldn't need to modify your code
      • let's say you weren't using docker, but you were using all these same components.
      • what would the approach be?
      • everything on localhost and different ports?
      • put different backends behind a common load balancer?
      • hyphenated joined the channel
      • something else?
      • nginx reverse proxy?
      • lavalamp joined the channel
      • at the end of the day, docker is just a fancy way to run a process. it provides networking isolation, and architectural changes that need to be introduced "because of docker" would need to be introduced in any multi-node setup (at least in my experience)
      • raijin joined the channel
      • __Yiota joined the channel
      • piratepete
        programmerq currently my angular app is part of a WAR for Tomcat. So the path (relative) e.g. api/login is okay. I've extracted the angular part and put it in another directory with a server.js. I started adding localhost:8080 (Tomcat app) to the urls in angular and started testing. I never got past the CORs issues.
      • programmerq
        ah, sounds like the splitting of angular from the rest of the tomcat would introduce this issue whether you're using docker or not. you could recombine the URL namespace with an nginx reverse proxy to avoid code changes.
      • webdev007 joined the channel
      • lvf has quit
      • piratepete
        programmerq now, ... I have the huge monolith app (REST with the angular) running as a docker image. I want to now create another docker image of the new angular and node server but I have to modify all the REST urls again but I'm not sure how best to do this
      • programmerq
        one nginx config file with multiple upstreams. if the URL pattern matches something for angular, send it there. if is anything else, send to tomcat.
      • Neotecha
        (beginner) ooooooo.. the issue i was running into was that i was doing the arguments out of order... `docker run -d imagename --name=test1`, rather than `docker run -d --name=test1 imagename`
      • >_<
      • programmerq
        still happens to me sometimes.
      • ljc joined the channel
      • Neotecha
        my dockerfile was 3 lines long, so i was really concerned i wasn't getting anything, haha
      • hyphenated has quit
      • piratepete
        programmerq will I be able to create my docker images for all moving parts in isolation and network them later. My app is a JHipster app and they recommend everything in the same directory and use docker-compose. I want to do everything in pieces first.
      • dangayle has quit
      • alaird has quit
      • piratepete has left the channel
      • jaimie joined the channel
      • theandromedan
        piratepete: I don't see any reason why not. docker-compose just makes putting things together easier.
      • jaimie has quit
      • kenrestivo has left the channel
      • sanscoeur joined the channel
      • Nightwolf has quit
      • Nightwolf joined the channel
      • daMaestro joined the channel
      • thebope has quit
      • thebope joined the channel
      • thebope has quit
      • evansde77 joined the channel
      • mischat joined the channel
      • mikebrow_ joined the channel
      • d^sh joined the channel
      • evansde77 has quit
      • jsgrant-_ joined the channel
      • mischat has quit
      • enderandpeter joined the channel
      • Emperor_Earth joined the channel
      • raijin has quit
      • grayhemp joined the channel
      • fakenerd joined the channel
      • grayhemp has quit
      • grayhemp joined the channel
      • fakenerd has quit
      • chachasmooth has quit
      • chachasmooth joined the channel
      • rebase joined the channel
      • grayhemp has quit
      • mikebrow_ joined the channel
      • umpc joined the channel
      • grayhemp joined the channel