docker-compose

搭建MAVEN私服Nexus

前提是你 提交于 2020-01-14 23:20:15
搭建MAVEN私服Nexus 继续采用docker-compose搭建 version: '3' services: nexus: restart: always image: sonatype/nexus3 container_name: nexus ports: - 8082:8081 volumes: - nexus-data:/nexus-data ## 前面那个nexus-data是和下面volumes.nexus-data那个对应 volumes: nexus-data: ##不要忘记 : 号了 这样写volumes不会出现权限和其它问题,不然启动可能就会报错 启动docker-compose up -d 通过docker-compose logs -f 查看日志 也可以通过 docker logs -f [容器id或者名称] 查看日志 启动成功则可以在浏览器中输入http://192.168.75.145:8082进入到管理页面 这里的登陆账号是admin ,,登陆的时候网页上会有提示的,可能版本不同,目录会不同,具体见网页上提示的目录,差不多就是获取密码要到容器里面去获取 docker exec -it 【容器id或者名称】 /bin/bash cd /nexus-data/ ##进到目录里面 cat admin.password 获取密码,密码比较复杂

Docker-Compose模板文件参数详解

梦想与她 提交于 2020-01-14 11:40:25
前言 模板文件是使用compose的核心,涉及到的指令关键字比较多,但是大部分和docker run相关参数的含义都是类似的。 默认的模板文件名称为docker-compose.yml,为yaml格式,如下: version: "3" services: webapp: image: examples/web ports: - "80:80" volumes: - "/data" 注意每个服务都必须通过 image 指令指定镜像或 build 指令(需要 Dockerfile)等来自动构建生成镜像。 如果使用 build 指令,在 Dockerfile 中设置的选项(例如:CMD, EXPOSE, VOLUME, ENV 等) 将会自动被获取,无需在 docker-compose.yml 中重复设置。 1、build 指定Dockerfile所在文件夹的路径(可以是绝对路径,或者相对docker-compose.yml文件的路径)。compose将会利用它自动构建这个镜像,然后使用这个镜像。 如下: version: '3' services: webapp: build: ./dir 也可以使用context指定dockerfile所在文件夹的路径,使用dockerfile指令指定dockerfile文件名,使用arg指令指定构建镜像时的变量。如下: version: '3'

【环境篇】搭建golang开发环境

人走茶凉 提交于 2020-01-14 11:08:52
学习一门语言,很多人都会是从搭建环境开始。有的语言的环境比较复杂,而有的语言环境很简单。对于go而言,说简单,的确不难,但有些概念需要先对其有所理解,才知道为什么这么用。网上对于怎么搭建一个golang开发环境已有了很多的教程,在这里我会简单介绍,不做过多描述。本篇文章仅对一些概念进行介绍,以及分享对一些我本人搭建开发环境的心得与技巧,如有错误,欢迎指正和交流。 搭建golang环境 1.到 golang下载地址 下载对应环境的安装包或者源码,若是Linux环境的话,将源码包下载解压之后,放至/usr/local/(实际上放至合适位置即可,只要把它添加进PATH就行),如: export PATH=$PATH:/usr/local/go/bin 2.配置GOPATH、GOROOT,这里可能需要解释一下,对于新手来说,肯定不熟悉这两个环境变量的意义。 GOROOT:golang的安装目录。 GOPATH:go的工作空间,在GOPATH下会有三个目录:src,bin,pkg。 src:存放源码(在不设置go mod的情况下,go get的包放至这里,你自己的项目源码也可以放在这里); bin:编译后的可执行文件放置的位置,如果在你项目go install,生成的可执行文件会放在此处; pkg:存放编译时产生的文件(.a文件)并根据平台进行归档,比如

Version in docker-compose is unsupported

Deadly 提交于 2020-01-14 08:53:07
问题 I try to install this docker-compose configuration. As you can see, it has version 3. When I run this with docker-compose build --pull , I got this error: ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use

How can I run a cron in MariaDB container?

♀尐吖头ヾ 提交于 2020-01-13 19:48:07
问题 I want to include a cron task in a MariaDB container, based on the latest image mariadb , but I'm stuck with this. I tried many things without success because I can't launch both MariaDB and Cron. Here is my actual dockerfile: FROM mariadb:10.3 # DB settings ENV MYSQL_DATABASE=beurre \ MYSQL_ROOT_PASSWORD=beurette COPY ./data /docker-entrypoint-initdb.d COPY ./keys/keys.enc home/mdb/ COPY ./config/encryption.cnf /etc/mysql/conf.d/encryption.cnf # Installations RUN apt-get update && apt-get -y

Moving Wordpress site to Docker: Error establishing DB connection

╄→尐↘猪︶ㄣ 提交于 2020-01-13 11:49:12
问题 Ive been making new sites with Wordpress & Docker recently and have a reasonable grasp of how it all works and Im now looking to move some established sites into Docker. Ive been following this guide: https://stephenafamo.com/blog/moving-wordpress-docker-container/ I have everything setup as it should be but when I go to my domain.com:1234 I get the error message 'Error establishing a database connection'. I have changed 'DB HOST' to 'mysql' in wp-config.php as advised and all the DB details

Unable to mount files in Docker

老子叫甜甜 提交于 2020-01-13 10:13:30
问题 Error description I'm unable to mount files in Vagrant or Docker, so it seems like it's an issue caused by some kind of a permission error. My OS is Ubuntu 18.04 LTS (Bionic Beaver) , I'm not running any access control modules like SELinux as far as I'm aware. The Vagrant-related discussion of the error is found in another question: Unable to mount files in Vagrant Troubleshooting Docker I'm unable to mount files into a Docker container with docker-compose, I'm trying to build: https://github

Unable to mount files in Docker

感情迁移 提交于 2020-01-13 10:11:10
问题 Error description I'm unable to mount files in Vagrant or Docker, so it seems like it's an issue caused by some kind of a permission error. My OS is Ubuntu 18.04 LTS (Bionic Beaver) , I'm not running any access control modules like SELinux as far as I'm aware. The Vagrant-related discussion of the error is found in another question: Unable to mount files in Vagrant Troubleshooting Docker I'm unable to mount files into a Docker container with docker-compose, I'm trying to build: https://github

How can I attach VS Code to a node process running in a docker container

故事扮演 提交于 2020-01-13 09:13:08
问题 I'm trying to attach the Visual Studio Code debugger to a node.js app that is running inside a Docker container. I start the app like: node --debug-brk app.js I expose the debugger port in docker-compose.yml : app: build: . working_dir: /code volumes: - .:/code command: npm run debug ports: - "3004:3000" - "5858:5858" My launch.json looks like: { "version": "0.1.0", "configurations": [ { "name": "Attach", "type": "node", "address": "localhost", "port": 5858 } ] } Now, when I start the

How can I attach VS Code to a node process running in a docker container

谁都会走 提交于 2020-01-13 09:12:18
问题 I'm trying to attach the Visual Studio Code debugger to a node.js app that is running inside a Docker container. I start the app like: node --debug-brk app.js I expose the debugger port in docker-compose.yml : app: build: . working_dir: /code volumes: - .:/code command: npm run debug ports: - "3004:3000" - "5858:5858" My launch.json looks like: { "version": "0.1.0", "configurations": [ { "name": "Attach", "type": "node", "address": "localhost", "port": 5858 } ] } Now, when I start the