#docker

/

      • kozy has quit
      • kozy joined the channel
      • rselbach joined the channel
      • thursdaddy has quit
      • hphuoc25 joined the channel
      • apus joined the channel
      • icarus joined the channel
      • rselbach has quit
      • GenteelBen has quit
      • jab416171 joined the channel
      • Bebef has quit
      • Bebef joined the channel
      • kp__ joined the channel
      • iamriel joined the channel
      • iamriel has quit
      • xchuck00 joined the channel
      • someclown joined the channel
      • oojacoboo has quit
      • thursdaddy joined the channel
      • oojacoboo joined the channel
      • littlebit1 joined the channel
      • littlebit has quit
      • littlebit1 is now known as littlebit
      • thursdaddy has quit
      • fc5dc9d4 joined the channel
      • fc5dc9d4_ has quit
      • thursdaddy joined the channel
      • tyx joined the channel
      • jnollette has quit
      • geggam joined the channel
      • et09 joined the channel
      • iamriel joined the channel
      • jnollette joined the channel
      • iamriel has quit
      • iamriel joined the channel
      • birdbolt1
        does anyone use uwsgi in alpine-linux?
      • I'd like to know what you set uid and gid to, thanks
      • Obi-Wan has quit
      • negaduck has quit
      • Obi-Wan joined the channel
      • thursdaddy has quit
      • thursdaddy joined the channel
      • bkhl joined the channel
      • hpotter
        birdbolt1: with nginx?
      • birdbolt1
        hpotter, not quite. nginx is in a separate container
      • by default i see the nginx config is set to use nginx as the user. uwsgi shows a warning everytime i run it, about setting a gid and uid, and up till now, i havent figured out what I could set that to in alpine
      • littlebit1 joined the channel
      • erkules has quit
      • littlebit has quit
      • littlebit1 is now known as littlebit
      • hpotter
        birdbolt1: The warning is: 'WARNING: you are running uWSGI as root !!! (use the --uid flag)'?
      • birdbolt1
        yup
      • beatzz_ joined the channel
      • works fine, but I'd like to resolve that, as I understand its recommended to set those values
      • hpotter
        I'd try to yse any non-root user. Either with docker run --user or with the USER statement in dockerfile.
      • Make sure your python app dir is accessible by the user.
      • birdbolt1
        well, its a container, and i dint wanna go into the mess of adding more users and managing them and their permissions ^
      • hpotter
        Then just use dockerrun --user=100:101 (100 is uid , 101 is gid).
      • beatzz has quit
      • BTW runing on openshift or kube cluster makes the same on the defailt security context.
      • birdbolt1
        oh thats good to know. I intended to use these images with kubernetes later
      • smccarthy joined the channel
      • one issue though; its built according to a docker compose file
      • I launch it with the other services detailed in the compose file
      • does that user flag work if I add it the entrypoint command in my dockerfile that starts uwsgi?
      • hpotter
        docker-compose up and docker-compose run supports --user as far as i know. Yes you can use --user with ready container with entrypoint and cmd. Just make sure all the programs, configs and data is accessible by used uid:gid.
      • birdbolt1
        got it, thanks!
      • salcedo
        can also be specified in the compose file
      • icarus has quit
      • fulanito joined the channel
      • fulanito
        Hi
      • do you have a tutorial or a reference for installing docker-ce in RHEL 7.3
      • I can upload any file to the server (rpm, sh, etc...)
      • I haven had any success
      • forgotmynick joined the channel
      • I have tried with rpms and isntalling all dependencies but I am blocked https://pastebin.com/47Bc9Gpc
      • Casper_v2 has quit
      • larsks
        Don't install rpms using 'rpm'. Always use 'yum', because it will resolve dependencies for you. If you are trying to install anything other than 'docker-ce', then something is wrong. You should be able to follow these instructions for getting docker-ce on rhel: https://docs.docker.com/install/linux/docker-ce...
      • (CentOS 7 packages should be compatible with RHEL 7)
      • fulanito
        larsks: thanks for the reply the reason I am installing it with rpms is because the servers has no internet access
      • catuca joined the channel
      • larsks
        So, you should still use 'yum', but set up a local repository with all the necessary packages.
      • lnbf joined the channel
      • fulanito
        ok thanks I will try that
      • catuca
        Let me preface this by saying that I am a total newbie at Docker. I managed to put a docker-compose.yml and Dockerfile together. Even thought I can access redis from the host machine, the containers are unable to. What am I doing wrong? https://pastebin.com/bUep5S3m
      • larsks
        How are the containers accessing redis?
      • catuca
        ok. So the wordpress container has a plugin called W3 Total Cache. That plugin takes a URL:port for Redis.
      • larsks
        And what url:port are you using?
      • catuca
        I type 127.0.0.1:6379 and click Test. The test fails.
      • larsks
        Well, there's your problem. "127.0.0.1" means "this container". Just like on your host "127.0.0.1" means "this host".
      • If you want to access the redis container, just use the hostname "redis".
      • catuca
        no way. that easy?
      • oh wow
      • ok. let me give it a stab.
      • brb
      • larsks
        The service names in your docker-compose.yaml can be used as hostnames.
      • catuca
        oh man
      • That is why db:3306 works
      • I get it now
      • larsks
        Docker maintains a dns server for user-defined networks (which docker-compose sets up implicitly)
      • catuca
        humm..interesting
      • wow cool
      • larsks
        fulanito: I don't have a good reference to point you to for that procedure. It would be much easier if you were able to get internet access for that machine (e.g., via a proxy or something), since that's really how the tools are meant to poerate.
      • Um, "operate", even.
      • catuca
        larsks: It worked!!!
      • larsks
        catuca: \o.
      • \o/
      • Man, fingers this evening.
      • catuca
        larsks: Thank you! This is awesome.
      • larsks: Do I still need to EXPOSE the ports?
      • larsks
        catuca: not at all.
      • Containers on the same network can access each other's ports without restriction.
      • catuca
        perfect
      • larsks: The mysql local directory sometimes creates, sometimes it doesn't. Not sure what is going on here: https://pastebin.com/bUep5S3m
      • sparklyballs has quit
      • Obi-Wan joined the channel
      • larsks
        I'm confused by lines 8 and 9, which both seem to be mounting something on /var/lib/mysql.
      • catuca
        larsks: me too. My understanding is that db_data is used for sharing that data amongst containers while line 9 is for mounting the mysql/ directory on the host and then map that to /var/lib/mysql
      • larsks
        Right, but the point is you can only have one thing mounted on a particular mountpoint. That's not a docker issue; that's just a normal linux issue. Do you want to use a local directory for mysql? Or do you want to use your db_data volume?
      • sparklyballs joined the channel
      • catuca
        larsks: That is a good question. I need to persist MySQL data so that when I destroy the containers and recreate it, I don't have to recreate the database schemas, tables and data
      • larsks
        Either solution will do that for you.
      • I would say go with the docker volume. Keeping data inside your project directory ends up getting complicated do to file ownership and permissions.
      • catuca
        larsks: Will db_data mount on the host as well?
      • larsks
        Not exactly, no.
      • I mean, ultimately, yes, everything is stored on your host :).
      • catuca
        gotcha. right ;)
      • larsks
        But you can't just mount it on a host directory in a way that you can access it directly.
      • catuca
        right
      • larsks
        But you can always expose it to arbitary containers.
      • catuca
        I understand that
      • right
      • larsks: Why would I need db_data anyways?
      • larsks
        Well, you want your database data to have a lifetime different from that of the container, right?
      • So you can re-create or replace (ugprade) the mysql container without losing your data.
      • catuca
        correct
      • So db_data makes that avaiable to the containers (which is saved on the host but it is only accessible by the containers) not the host
      • larsks
        I would not phrase it like that, no. db_data is a data volume, which is storage managed by docker that has a lifetime independent of the containers to which it is attached.
      • catuca
        gotcha
      • larsks
        Your mysql container would work just fine without the volume, and the data would still be stored "on disk", but you would lose it whenever the container exited.
      • catuca
        What is the lifetime of db_data?
      • tehdude joined the channel
      • larsks
        It will live until you explicitly remove it (for example, with 'docker-compose down -v')
      • (where the '-v' means 'remove volumes')
      • catuca
        ahh ok
      • So I would have to physically remove the volume
      • got it
      • ok cool
      • thursdaddy has quit
      • zerocoolback joined the channel