![]() ![]() ![]() > # entrypoint.sh will prompt you to do this. > # If you update requirements, you should rebuild the container. > Signed-off-by: Daniel Axtens > - > tools/docker/Dockerfile | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > diff -git a/tools/docker/Dockerfile b/tools/docker/Dockerfile > index eb6d35d82528.31b2aaeedf49 100644 > - a/tools/docker/Dockerfile > +++ b/tools/docker/Dockerfile > -1,6 +1,7 > FROM ubuntu:17.10 > ARG UID=1000 > +ARG TZ="Australia/Canberra" > ENV PROJECT_HOME /home/patchwork/patchwork > -22,12 +23,15 RUN apt-get update -qq & \ > python3.5-dev python3-pip python3-setuptools python3-wheel \ > python3.4-dev findutils=4.4.2-7 python3.6-dev \ > libmysqlclient-dev mysql-client curl unzip xvfb chromium-chromedriver \ > - chromium-browser build-essential git postgresql-client & \ > + chromium-browser build-essential git postgresql-client tzdata & \ > ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/ > # User > RUN useradd -uid=$UID -create-home patchwork > +# Timezone > +RUN rm /etc/localtime ln -s /usr/share/zoneinfo/$TZ /etc/localtime > + > # Python requirements. This is unfortunate: the Django TZ in > settings/base.py is Australia/Canberra, and having a non-UTC > TZ is good for exposing faulty assumptions about what is and > isn't UTC. > The tzinfo package isn't installed in docker, which makes the > default timezone UTC. To: docker: set timezone to Australia/CanberraĬontent-Type: text/plain charset="utf-8"ĭocker: set timezone to Australia/Canberraĭaniel Axtens April 5, 2018, 9:47 a.m. X-Google-Smtp-Source: AG47ELuFBi92kqPrx45ii5/vzzBpk/kyiKtk995YkTxuFTO4xNTlF+oknjyQnM1gZCQns+q4pnbe7A= X-Gm-Message-State: AElRT7EGv1pKWpRnL108+Zmb4n5K1ulclKli8+sKzin5cs93tK2z/0fx Wqk/MKDEVCEk5jDAbtCYjDm5rD3AP4nGpDRf09cLd4yW0jj0lLHwcDctRweJoRknWM1y H=x-gm-message-state:from:to:cc:subject:date:message-id ī=WkI5pFdgkNHPymCjhIELd+c69Hpd16rSINEPsUfmPdON92vMrXq9j1f/nKPg2+pCt1ĬUiBUocdn6ikU/Hy0V3DoRFRBmC1fmuxlBAb15bxPW1ArAApNtA5gksnGwl8M93s9pov X-Google-DKIM-Signature: v=1 a=rsa-sha256 c=relaxed/relaxed W+wdyMdMDTidI/jjUrtitvTvRFGg5XVTetK2cYX3QRei26cBYWsrEwna3lYBRxiJr2TL Received: by with SMTP id x82so6468330wmg.1ĭKIM-Signature: v=1 a=rsa-sha256 c=relaxed/relaxed d= s=google īh=4RB8zi1ySebNGNeW8VRZlq3TmL8fbZDT6W8LeHuZhfE= ī=Cl50nqscvPomAnPOUnaz+S3NKYZeJILiqUJR/EgxV1NV/1w77EUoOkZ7sOrcoDkUap (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128īy (Postfix) with ESMTPS id 405SRF2MtXzF0xD Received: from ( )īy (Postfix) with ESMTP id 405SRQ25N2zF1XBĪuthentication-Results: (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))īy (Postfix) with ESMTPS id 405SRQ40R4z9s0vĭmarc=none (p=none dis=none) om=ĭkim=fail reason="signature verification failed" (1024-bit key ![]() You'll be able to connect using port 3306 on the MySQL container's hostname (this matches the service name defined in your Compose file).X-Original-To: from ( ) Both containers will exist in the same Docker network. Define another service for the new container. If you need to connect from another Docker container, it's best to use Docker Compose. You'll now be able to connect to localhost:33060 using MySQL clients running on your host. If you're not using Docker Compose, pass -p 33060:3306 to docker run when you start your container. Example snippet when launching FileRun via Docker Compose: db: image: mariadb:10.1 environment: TZ: 'America/LosAngeles' When launching the MySQL container separately: docker run -it-rm-e TZ 'America/LosAngeles' mysql: 5. This will bind port 33060 on your host machine to the container's port 3306. You can adjust the MySQL timezone easily, by adding an environmental variable TZ. Add the following to your docker-compose.yml file, within the mysql service definition: ports: Bind a host port to the container's port 3306. ![]() You must setup a port binding if you want to access MySQL from your host. To import a SQL file from your filesystem, you can pipe it into the command: docker exec -it my-mysql mysql -psecret database_name < path-to-file.sql This command opens a shell as the root user and prompts for a password. This provides the full MySQL command-line interface, so you can use all the familiar commands and flags. You can gain an interactive MySQL shell by attaching to the container and running the mysql command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |