Tag: 泊坞窗

在Docker中安装pgsql卷

我有一个基于centos:latest的自定义Dockerfile centos:latest安装我需要运行我使用的Web框架的软件。 我想扩展这个Dockerfile,这样我就可以添加PostgreSQL了,我想把pgsql的默认数据位置从/var/lib/pgsql改为/var/www/data/pgsql ,这是一个挂载文件系统的卷。 我不确定是否可以在Dockerfile中执行此操作,或者是否需要在容器中运行某些脚本。 任何帮助,将不胜感激。

在Docker容器中访问Tomcat时发生CORS错误

我正在构build一个使用REST API与Camunda进程交互的Angular 4应用程序。 尝试login,面临CORS错误。 Dockerfile: FROM camunda/camunda-bpm-platform:tomcat-latest ADD sample.war /camunda/webapps/sample.war COPY ./web.xml /camunda/webapps/engine-rest/WEB-INF 像这样运行它: docker build -t camunda-eval . docker run -d –name camunda -p 8080:8080 <image> 控制台中出现错误: 无法加载http:// localhost:8080 / camunda / api / admin / auth / user / default / login / tasklist :请求的资源上没有“Access-Control-Allow-Origin”头。 原因' http:// localhost:4200 '因此不被允许访问。 我的web.xml如下所示: <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" […]

从同一个物理机器访问docker上运行的PostgreSQL

我是新来的docker,下面是我的Dockerfile部分启动postgreSQL: RUN apt-key adv –keyserver hkp://p80.pool.sks-keyservers.net:80 –recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 USER postgres RUN /etc/init.d/postgresql start &&\ psql –command "CREATE USER postgres1 WITH SUPERUSER PASSWORD 'password';" &&\ createdb -O postgres1 password RUN echo "host all all 0.0.0.0/0 md5" […]

用docker运行谷歌数据存储模拟器

我正在尝试与docker创build数据存储模拟器,并按照https://cloud.google.com/datastore/docs/tools/datastore-emulator 我还使用了云端SDK https://hub.docker.com/r/google/cloud-sdk/ 我能够创build模拟器并进行身份validation,但是当我尝试访问它throght localhost:8000 / datastore它给了我“未find”的回应, 我怎样才能访问数据存储数据? 我用来创build它的命令是: docker run -p 8000:8000 google/cloud-sdk gcloud beta emulators datastore start –project=pname –host-port localhost:8000 –no-store-on-disk

在云代工的Docker中启用HTTPS的Spring Boot应用程序

我创build了一个基于spring的应用程序,它的application.yml文件是这样的: server: port: 8108 tomcat: remote_ip_header: x-forwarded-for protocol_header: x-forwarded-proto 它也在https端口上运行。 我部署这个应用程序在云代工,它已成功部署并运行在https url,并正常工作。 现在我用下面的configuration为这个应用程序创builddockerfile: FROM frolvlad/alpine-oraclejdk8 VOLUME /tmp ADD <name-of-jar>.jar aap.jar EXPOSE 8108 ENTRYPOINT ["java","-jar","/aap.jar"] 并使用以下命令将其推送到启用docker的代工厂: cf push -m 2g –docker-image /:–docker-username 它成功部署并开始,但是当我尝试通过它的URL访问它: https://开头 我得到以下例外: 2017-10-26T18:03:52.48+0530 [APP/PROC/WEB/0] OUT javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? 2017-10-26T18:03:52.48+0530 [APP/PROC/WEB/0] OUT 12:33:52.488 [DEBUG] [ ] [-exec-7] [ org.apache.tomcat.util.net.NioEndpoint]: Error during […]

Docker WordPress保持redirect到网站的在线版本

我试图在Ubuntu 17.10上设置docker wordpress作为我的开发环境。 我已经做了一个数据库的副本,并将其放置在8080端口的docker服务器mysql(使用一个WP插件,它改变了家庭和网站的url) 我已经到了下面的docker-compose.yml文件,但是每次我到localhost:8000或者80端口,我都会被redirect到原来的网站。 我不知道什么是错的 version: '3' services: db: image: mysql:5.7 volumes: – db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: rootPword MYSQL_DATABASE: xyz_wp MYSQL_USER: xyz_2015 MYSQL_PASSWORD: userPword wordpress: depends_on: – db image: wordpress:latest ports: – "8000:80" restart: always environment: # generally need to use non-default values WORDPRESS_DB_HOST: db:3306 # next line often not in tutorials – […]

连接时Gorm + Docker错误

我试图用Docker连接到我的postgresql数据库: package main import ( "fmt" "log" "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/postgres" ) type Product struct { gorm.Model Code string Price uint } var db *gorm.DB func init() { connection := fmt.Sprintf("host=db sslmode=disable user=dnz-dev password=dnz-dev") db, err := gorm.Open("postgres", connection) if err != nil { log.Fatalln(err) } defer db.Close() } func main() { // Migrate the schema […]

如何修复“未知的错误:Chrome无法启动:exception退出”在Docker中运行chrome?

我想用jenkins在jenkins实例中运行seleniumtesting。 为了testing这个,我使用下面的Dockerfile创build一个Dockerfile : FROM python:2.7-slim WORKDIR /selenium ADD . /selenium # Install any needed packages specified in requirements.txt RUN pip install –trusted-host pypi.python.org -r requirements.txt # Install some basic stuff RUN apt-get update -qqy RUN apt-get install -y wget xvfb bzip2 zip unzip # Install all the chrome libraries… RUN apt-get install -y gconf-service libasound2 […]

knex种子不在docker环境中工作

我为一些REST API使用nodejs和knex 。 我使用这个代码来运行迁移和种子 knex.migrate.latest() .then(() => { return knex.seed.run(); }) .then(() => { // migrations are finished, init server }); 我正在使用远程 数据库进行此testing。 当我使用node index.js从本地主机运行它时,它运行良好,迁移运行,然后数据库填充种子。 但是,当我创build一个Docker镜像并运行它时, 迁移按预期工作,但种子失败。 日志输出如下: Segmentation fault npm ERR! code ELIFECYCLE npm ERR! errno 139 npm ERR! com.app@0.2.0 start: `ENV=prod node index.js` npm ERR! Exit status 139 npm ERR! npm ERR! Failed […]

无法使用IP访问Docker数据库(仅本地主机)

我正在尝试设置Docker以允许来自我networking上其他设备的连接。 目前访问Docker我访问我的电脑上的localhost 。 我试图连接使用我的电脑的本地IP( 192.168.0.140 ),这让我看到我的文件,但没有连接到我的数据库。 我认为这是我的configuration有问题,但我不知道Docker排除故障。 version: '2' services: webserver: build: ./docker/webserver image: localdev ports: – '80:80' – '443:443' volumes: – ./www:/var/www/html links: – db db: image: mysql:5.6 ports: – 3306 volumes: – ./db:/var/lib/mysql environment: – MYSQL_ROOT_PASSWORD=secret phpmyadmin: image: phpmyadmin/phpmyadmin:latest links: – db environment: PMA_HOST: db PMA_PORT: 3306 MYSQL_USER: root MYSQL_ROOT_PASSWORD: secret ports: – […]