docker-compose

Containerizing Apache, MySQL and PHP With Docker

∥☆過路亽.° 提交于 2019-12-06 10:03:10
问题 I've been searching the web and reading manuals and I just can't seem to get my head around what is wrong with my Docker setup. The Goal To container-ize Apache, PHP and MySQL allowing them to be customized on a per-project basis. The only dependency to deploy the stack should be docker. All other dependencies / actions should be able to be able to be built / run via Dockerfile . The Proof of Concept From my Apache + MySQL + PHP stack via docker-compose.yml file - I'd like to target an index

go get in Dockerfile. I got cannot find package error

你离开我真会死。 提交于 2019-12-06 09:55:24
I added RUN go get to install packages during "docker-compose". However, the following cannot find package error was occurred when I run go build . I found that the packages are saved in /go/pkg/linux_amd64/ . run docker-compose and go build $ docker-compose up -d $ docker exec -it explorer-cli /bin/bash # pwd /go # ls bin pkg src # echo $GOPATH /go # ls /go/pkg/linux_amd64/github.com/ go-sql-driver # go build -i -o /go/bin/explorer-cli src/main.go src/main.go:6:2: cannot find package "github.com/go-sql-driver/mysql" in any of: /usr/local/go/src/github.com/go-sql-driver/mysql (from $GOROOT)

Docker compose specifying image vs Dockerfile

三世轮回 提交于 2019-12-06 09:35:50
问题 I'm new to docker-compose and after reading the docs I still have some unclear things that comes to my mind. So far when I used docker I kept the builds in the following directory tree: builds: Service A: Dockerfile ServiceA.jar Service B: Dockerfile ServiceB.jar So when I want to run all I use some shell script, until I read about docker-compose . I saw that there are 2 ways of creating and running a service (in manner of copying files) Specifying build: path/to/my/build/directory and

Dockerized Django with webpackDevServer

早过忘川 提交于 2019-12-06 09:13:18
问题 I need some help with a Docker configuration to make Django work with webpack dev server in development mode. I want django docker container to get access to the webpack generated bundle. I'm struggling to understand how containers share files with volumes in docker-compose. Until now I only managed to have a working django dockerized app and then I run npm install && node server.js locally. Dockerfile # use base python image with python 2.7 FROM python:2.7 ENV PYTHONUNBUFFERED 1 # set

Accessing node_modules after npm install inside Docker

﹥>﹥吖頭↗ 提交于 2019-12-06 08:58:04
问题 I am running Docker with Docker Machine on Mac. I successfully set up some containers and ran npm install inside them, as explained here. This installs the node_modules inside the image and inside the container, but they are not available on the host, i.e. my IDE complains about missing node_modules. Am I missing something? What is the best way to run npm install inside the container but be able to do development (with these dependencies) on the host? From my docker-compose.yml: volumes: -

企业级 Harbor 镜像仓库

三世轮回 提交于 2019-12-06 08:52:21
企业级 Harbor 镜像仓库 Harbor是由VMWare公司开源的容器镜像仓库。事实上,Harbor是在Docker Registry上进行了相应 的企业级扩展,从而获得了更加广泛的应用,这些新的企业级特性包括:管理用户界面,基于角色的 访问控制 ,AD/LDAP集成以及审计日志等,足以满足基本企业需求。 官方地址:https://vmware.github.io/harbor/cn/ harbor-adminserver 配置管理中心 harbor-db Mysql数据库 harbor-jobservice 负责镜像复制 harbor-log 记录操作日志 harbor-ui Web管理页面和API nginx 前端代理,负责前端页面和镜像上传/下载转发 redis 会话 registry 镜像存储 1、安装docker与docker-compose 下载地址 https://github.com/goharbor/harbor/releases/tag/v1.9.1 1、安装docker与docker-compose curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker

Cannot access nodejs app on browser at localhost:4200 (docker run -p 4200:4200 …)

左心房为你撑大大i 提交于 2019-12-06 08:43:22
Please I need some help, new to docker; have a feeling it's something minor I missed. I'm trying to run a nodejs app using a dockerfile and docker-compose; I'm on Ubuntu 17.04 LTS however, eventhough the status shows UP and runnning I can't access the app from localhost:4200 docker-compose.yml version: '3' services: my-app: build: context: . dockerfile: Dockerfile restart: unless-stopped volumes: - .:/usr/src/app ports: - "4200:4200" docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e6a99aab4e37 my-app "ng serve" 10 minutes ago Up 10 minutes 0.0.0.0:4200->4200/tcp my-app_1 I ran

使用docker-compose部署nginx

最后都变了- 提交于 2019-12-06 08:42:16
1、新建docker-compose.yml文件,文件的基本模板如下:(由于yml格式比较严格,注意空格缩进) version: '2.0' services: nginx: restart: always image: nginx:1.11.6-alpine ports: - 8080:80 - 80:80 - 443:443 volumes: - ./conf.d:/etc/nginx/conf.d - ./log:/var/log/nginx - ./www:/var/www - /etc/letsencrypt:/etc/letsencrypt 参数说明: version :版本号,好像我这上面2和2.0有区别,不能写成2,写成2的话,docker-compose up -d 时会报错,提示版本号要写成2.0的样子,不过有的地方我看着直接写成2也是可以的,可能是我的docker-compose版本不一致。 service :就是要定义的docker容器 nginx :容器的名称 restart :设置为always,表明此容器应该在停止的情况下总是重启,比如,服务器启动时,这个容器就跟着启动,不用手动启动,服务器启动之后,进入到docker-compose.yml文件路径下,执行docker-compose ps可以看到,该容器正在运行。 image :这个是需要依赖的容器

Which Docker template values are available in docker stack deploy (compose)?

爷,独闯天下 提交于 2019-12-06 08:38:01
Where can I find out which template values are available in my Docker UCP Swarm cluster? With template values I mean things like this https://docs.docker.com/engine/reference/commandline/service_create/#create-services-using-templates . I get the feeling that the tree I'm traversing looks a bit like docker inspect output, but a smaller set of it. Which keys? and which expressions can I use? Besides that, I often get errors like for {{.Engine.Labels}} <.Engine.Labels>: can't evaluate field Engine in type *template.Context So, it seems the context in which the tree is stored is 'Context'. Which

How do I run migrations in Dockerized Django?

血红的双手。 提交于 2019-12-06 08:22:10
I followed a Docker + Django tutorial which was great, in that I could successfully build and run the website following the instructions. However, I can't for the life of me figure out how to successfully run a database migration after changing a model. Here are the steps I've taken: Clone the associated git repo Set up a virtual machine called dev with docker-machine create -d virtualbox dev and point to it with eval $(docker-machine env dev) Built and started it up with: docker-compose build and docker-compose up -d Run initial migration (the only time I'm able to run a migration that