Announcement

Collapse
No announcement yet.

Installing docker-compose on Kubuntu (or any Ubuntu)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Installing docker-compose on Kubuntu (or any Ubuntu)

    As of this post the Docker docs have not been fully updated and may lead you down a very headachy path of trying to get the latest stable version of docker-compose.

    If you are having trouble with getting the "official" version of docker-compose (v 1.2x) to work with recent images there is solution.

    Buried deep in the Docker docs is one sentence that says something to the effect of "don't bother installing it via snap or apt because those versions are old, use Docker Desktop instead."

    If you do this, you will eventually run into a statement to the effect of "if you are on Linux you are SOL and just have to install docker-compose the old fashioned way."

    These two statements are mutually exclusive. And only one of them is correct. Luckily, it is the former. If you install Docker Desktop then you do NOT need to install docker-compose AT ALL. The current iteration of Docker Desktop comes with version 2 of docker-compose. The syntax is one character different. Simply replace the hyphen with a space and you are good to go with the latest version of docker compose and you can use the latest yaml spec.

    Version 1.2x
    Code:
    docker-compose up -d
    Docker Desktop
    Code:
    docker compose up -d

    ___

    If you are using XAMPP or similar it is worth learning to use Docker. It's easier to use and less resource intensive than the ancient bronze age way of installing mysql and apache on your system.

    You can start with the official tutorial https://docs.docker.com/get-started/

    It has a few minor glitches but it's pretty good overall. It's out of date in relation to docker-compose. But just change the syntax as I stated above and you will be fine.



    #2
    Alas I could have done with your advice about 3 weeks ago. I blundered my way to a functional docker, having to reverse out the docker-compose install because it conflicted with the docker desktop one.

    I gained the impression that there's a lot to learn, and that other approaches to containers, such as LXC, are simpler and a better fit on Linux. I can't help but think that docker does a lot of stuff so that it can work on Windows.
    Regards, John Little

    Comment


      #3
      Originally posted by jlittle View Post
      I can't help but think that docker does a lot of stuff so that it can work on Windows.
      I think they get Windows compatibility first because that's what almost every corporate tech stack runs on. They do get around to us eventually.

      I'm not seeing any appreciable resource hit from Docker itself. A bit from qemu-kvm.service. But I start and stop it manually. Using Docker has allowed me to get rid of apache and mysql services. mysql.service was a major system resource hog. And Docker Desktop means it's gone for good.

      One of the things I'm liking about Docker Desktop is that all the CLI commands use the same structure. Once you learn how to use one, you've just learned how to use most of the others as well.

      I'll post some of my other Docker related notes below.
      Last edited by TwoFistedJustice; Jul 22, 2022, 03:14 PM.

      Comment


        #4
        Goal: Use Docker-Desktop (dd) with PHPStorm on Ubunutu 20.04

        Why: Because the apt-get docker suite is too low of a version to run the most recent docker-compose yaml files.

        Phpstorm is already installed and configured to work with apt suite docker.


        What I did:

        Step one:
        Uninstalled all the old docker suite and all refs to same.
        https://askubuntu.com/questions/9355...install-docker


        Step two:
        Install docker desktop
        https://docs.docker.com/desktop/install/linux-install/


        Step three:
        Connect PHPStorm to docker desktop
        PHPStorm has incomplete dd integration and there is no way to directly connect them. So you have to create a symlink between the hardcoded docker.sock location set in phpstorm and the actual location used by dd.
        https://youtrack.jetbrains.com/issue/IDEA-294871/Docker-desktop-for-linux-create-dockersock-in-other-folder-instead-of-varrundockersock?_gl=1*ai3dsx*_ga*MTI5MzQzMjgwMy4x NjUzNTM4NzY4*_ga_9J976DJZ68*MTY1Nzc1Mjc5Ny4xNy4xLj E2NTc3NTQ0MDUuNTE.&_ga=2.13438967.1928156116.16577 52798-1293432803.1653538768


        Step four:
        PHPStorm settins has a section titled "Build, Execution, Deployment" with its own "Docker" sub-section.
        I would like to add that in order to get docker desktop's compose to work you have to go into

        Code:
        Settings >> Build, Execution, Deployment >> Tools
        Check the box labeled:
        Code:
        Use Compose V2
        (at this time labeled 'beta') and Apply

        You should now be able to use 'docker compose up' in terminal as normal.

        Comment


          #5
          When using Docker Hub you will need to login from terminal. This post I made on unix.stackexchange explains how to set it up so you don't have to type your password every time. (if this helps you please remember to vote up my answer on stackexchange)

          https://unix.stackexchange.com/quest.../710215#710215
          Last edited by TwoFistedJustice; Jul 22, 2022, 03:17 PM.

          Comment

          Working...
          X