Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rvalyi/3c4adfcfcf8a4cb73c8ab10ddafaef38 to your computer and use it in GitHub Desktop.
Save rvalyi/3c4adfcfcf8a4cb73c8ab10ddafaef38 to your computer and use it in GitHub Desktop.
# install on Ubuntu Server 20.04 LTS (Ubuntu Focal) or Debian 10 (Buster)
sudo apt-get update
sudo apt-get install byobu
byobu
# install Docker:
sudo apt-get install -y\
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
sudo apt install docker.io
# Start docker and enable it to start after the system reboot:
sudo systemctl enable --now docker
# give user administrative privileges to docker:
sudo usermod -aG docker $USER
# logout and login again
# check that Docker is working with
docker ps
# install ak and docky:
sudo apt-get install python3-pip
python3 -m pip install git+https://github.com/akretion/ak.git#egg=ak
python3 -m pip install git+https://github.com/akretion/docky.git#egg=docky
# or pip3 install on Debian may be
# install and run an Odoo Docky template https://github.com/akretion/docky-odoo-template
# alternatively, if you have an existing Docky project, clone your Docky repository instead
git clone https://github.com/akretion/docky-odoo-template odoo_project
# you can use Docky with Traefik (handy for dev) or Nginx, but this command is required for this Docky template:
docker network create traefik
cd odoo_project/odoo
ak build
cd ..
docky init # create the .env file and accept dev mode for now.
# if you cloned a Docky template, choose no to "generate docker-compose.yml automatically?"
# now edit the .env file and define the following environment variables PGHOST, PGDATABASE, PGUSER, DB_USER
# so your .env file may look like (cat .env here)
UID=1000
ENV=dev
COMPOSE_FILE=docker-compose.yml:dev.docker-compose.yml
COMPOSE_PROJECT_NAME=main-user_odoo-project
PGHOST=db
PGDATABASE=db
PGUSER=odoo
DB_USER=odoo
# Now you should be good to run Docky!
docky run
# start Odoo inside the Docky container
odoo
# let's move out of the Docky container back into the host to finish the installation,
# you can use F2 or F4 to move to another Byobu tab for that for instance.
# you might learn more about Docky here https://github.com/akretion/docky
# now install nginx
apt-get install nginx
# credit for nginx config: https://github.com/Yenthe666/InstallScript
wget https://gist.githubusercontent.com/rvalyi/2d53b88d9260d99aaacd0f10493ba1db/raw/b4bb944e06407a244fde135c7ef5ff3063f63e77/odoo-nginx.cfg
# edit the configuration:
vi odoo-nginx.cfg
# and replace:
#$WEBSITE_NAME -> *.* or real site name
#$OE_USER -> odoo
#$OE_PORT -> 8069
#$LONGPOLLING_PORT -> 8072
sudo mv odoo-nginx.cfg /etc/nginx/sites-available/odoo
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx reload
# then configure it...
# to be continued
# TODO nginx config, letsencrypt, backups...
@EBII
Copy link

EBII commented Oct 12, 2020

you can block on docker ps if docker.io was masked, by exemple in an upgrade

Failed to start docker.service: Unit docker.service is masked.
you can test :
sudo systemctl unmask docker
sudo systemctl start docker

@EBII
Copy link

EBII commented Oct 12, 2020

which credsStore you use ? I found this for set it to pass ans not service...
here is what i did to get my docker client working with docker-credentials-pass.

Install pass

sudo apt-get install pass

Download, extract, make executable, and move docker-credential-pass

wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.0/docker-credential-pass-v0.6.0-amd64.tar.gz && tar -xf docker-credential-pass-v0.6.0-amd64.tar.gz && chmod +x docker-credential-pass && sudo mv docker-credential-pass /usr/local/bin/

Create a new gpg2 key.

gpg2 --gen-key

Follow prompts from gpg2 utility

Initialize pass using the newly created key

pass init ""

Add credsStore to your docker config. This can be done with sed if you don't already have credStore added to your config or you can manually add "credStore":"pass" to the config.json.

sed -i '0,/{/s/{/{\n\t"credsStore": "pass",/' ~/.docker/config.json

Login to docker

docker login

References:
https://hackernoon.com/getting-rid-of-docker-plain-text-credentials-88309e07640d
https://www.passwordstore.org/

@rvalyi
Copy link
Author

rvalyi commented Oct 15, 2020

sorry I used the script again and I don't see that kind of issue neither on Ubuntu neither on Debian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment