- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
因为我最近开始使用 revel 框架来构建 go web 应用程序。我创建了一个测试应用程序 (orpat),将其编译为“revel build orpat prod”并更改了 conf PORT->8084 以发布该应用程序。生成的文件是 -
它从其他位置在我的本地系统上执行良好(当然它安装了 golang 和 revel)。 http://localhost:8084
我将构建文件复制到未安装 golang 的虚拟机中,它也在那里执行 './run.sh':在终端中运行此 cmd 足以使应用联机。
下面是dockerfile->
FROM golang:1.10.4-alpine3.8
RUN apk --no-cache add ca-certificates
RUN apk add --no-cache bash
COPY . /go/src/orpat
WORKDIR /go/src
EXPOSE 8084/tcp
RUN chmod -vR 777 /go/src/orpat
CMD [ "bash", "run.sh" ]
通过“docker build -t orpat”创建图像。工作正常。
a@kc:~/docker/orpat$ sudo docker build -t orpat .
Sending build context to Docker daemon 12.02MB
Step 1/8 : FROM golang:1.10.4-alpine3.8
---> 20834f40149c
Step 2/8 : RUN apk --no-cache add ca-certificates
---> Running in 154c0f3024f1
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
OK: 5 MiB in 14 packages
Removing intermediate container 154c0f3024f1
---> 50d5c49f8eee
Step 3/8 : RUN apk add --no-cache bash
---> Running in b3c9ad1bfe06
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(2/5) Installing ncurses-terminfo (6.1_p20180818-r1)
(3/5) Installing ncurses-libs (6.1_p20180818-r1)
(4/5) Installing readline (7.0.003-r0)
(5/5) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
Executing busybox-1.28.4-r0.trigger
OK: 14 MiB in 19 packages
Removing intermediate container b3c9ad1bfe06
---> 8ac100f8ab2f
Step 4/8 : COPY . /go/src/orpat
---> 7545fd3bf0d4
Step 5/8 : WORKDIR /go/src
---> Running in 469df33c4fea
Removing intermediate container 469df33c4fea
---> 69f0e4c2c42f
Step 6/8 : EXPOSE 8084/tcp
---> Running in 716e1d7b7f0f
Removing intermediate container 716e1d7b7f0f
---> 2bbd4e3c90b7
Step 7/8 : RUN chmod -vR 777 /go/src/orpat
---> Running in 1e9286d6f9ad
mode of '/go/src/orpat' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/500.txt' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/405.xml' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/500.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/405.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/404.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/500.xml' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/500.json' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/403.txt' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/403.json' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/404.txt' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/404.json' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/405.txt' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/404.xml' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/404-dev.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/405.json' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/403.xml' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/500-dev.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/templates/errors/403.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/conf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/revel/conf/mime-types.conf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/testrunner.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/plugin.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/controllers' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/controllers/testrunner.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/views' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/views/TestRunner' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/views/TestRunner/SuiteResult.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/views/TestRunner/Index.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/app/views/TestRunner/FailureDetail.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/js/jquery-1.9.1.min.js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/js/bootstrap.min.js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/js/highlight.pack.js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/images' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/images/favicon.png' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/css' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/css/github.css' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/public/css/bootstrap.min.css' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/conf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/testrunner/conf/routes' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/static' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/static/static.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/static/app' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/static/app/controllers' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/github.com/revel/modules/static/app/controllers/static.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/log' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/log/orpat-requests.json' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/README.md' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/tmp' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/tmp/main.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/init.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/routes' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/routes/routes.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/controllers' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/controllers/app.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/header.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/footer.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/flash.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/debug.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/App' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/App/Index.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/errors' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/errors/500.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/app/views/errors/404.html' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/messages' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/messages/sample.en' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/js/bootstrap-3.3.6.min.js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/js/jquery-2.2.4.min.js' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/fonts' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/fonts/glyphicons-halflings-regular.woff2' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/fonts/glyphicons-halflings-regular.woff' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/fonts/glyphicons-halflings-regular.ttf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/img' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/img/favicon.png' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/css' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/public/css/bootstrap-3.3.6.min.css' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/tests' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/tests/apptest.go' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/conf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/conf/routes' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/src/orpat/conf/app.conf' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/run.sh' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/Dockerfile' changed to 0777 (rwxrwxrwx)
mode of '/go/src/orpat/orpat' changed to 0777 (rwxrwxrwx)
Removing intermediate container 1e9286d6f9ad
---> cceab940ff2c
Step 8/8 : CMD [ "bash", "run.sh" ]
---> Running in 41b7bf5daee6
Removing intermediate container 41b7bf5daee6
---> 51ee4984d102
Successfully built 51ee4984d102
Successfully tagged orpat:latest
但是在从图像创建容器时,它被创建并处于退出状态。重新启动时,它再次进入 Exited。浏览器8084端口无法浏览应用。
a@kc:~/docker/orpat$ sudo docker run -d -it -p 8084:8084 orpat
e0d87929635b1a0340b7ef297c1d01c1b9961d3e7562da6e9d79691a579058fd
a@kc:~/docker/orpat$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a@kc:~/docker/orpat$ sudo docker ps --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e0d87929635b orpat "bash run.sh" 17 seconds ago Exited (127) 16 seconds ago naughty_easley
7ed9b052abff sample:1.0 "npm start" 5 days ago Exited (0) 4 days ago sample_app
74b229937da3 mongo:3.0.15 "docker-entrypoint.s…" 5 days ago Exited (0) 4 days ago sample_db
a@kc:~/docker/orpat$ sudo docker container start naughty_easley
naughty_easley
a@kc:~/docker/orpat$ sudo docker ps --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e0d87929635b orpat "bash run.sh" 46 seconds ago Exited (127) 2 seconds ago naughty_easley
7ed9b052abff sample:1.0 "npm start" 5 days ago Exited (0) 4 days ago sample_app
74b229937da3 mongo:3.0.15 "docker-entrypoint.s…" 5 days ago Exited (0) 4 days ago sample_db
所以我进入一个全新的容器,然后执行这个->
'sudo docker run -it -p 8084:8084 orpat bash'
并收到类似的错误->
a@kc:~/docker/orpat$ sudo docker run -it -p 8084:8084 orpat bash
bash-4.4# pwd
/go/src
bash-4.4# ls -a
. .. orpat
bash-4.4# cd orpat/
bash-4.4# ls -a
. .. Dockerfile orpat run.sh src
bash-4.4# cat Dockerfile
FROM golang:1.10.4-alpine3.8
RUN apk --no-cache add ca-certificates
RUN apk add --no-cache bash
COPY . /go/src/orpat
WORKDIR /go/src
EXPOSE 8084/tcp
RUN chmod -vR 777 /go/src/orpat
CMD [ "bash", "run.sh" ]
bash-4.4# ./run.sh
./run.sh: line 3: /go/src/orpat/orpat: not found
bash-4.4# bash run.sh
run.sh: line 3: /go/src/orpat/orpat: No such file or directory
bash-4.4# cat run.sh
#!/bin/sh
SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)
"$SCRIPTPATH/orpat" -importPath orpat/ -srcPath "$SCRIPTPATH/src" -runMode prod
bash-4.4#
在 conf 文件上,我已经
# The IP address on which to listen.
http.addr = [::]
# The port on which to listen.
http.port = 8084
谁能帮我解决这个问题,我正在寻找要部署的 exe 二进制文件。因为这是一个只有一个页面的最小测试应用程序,所以我停留在原来的 sprint 上。
最佳答案
我做这样的事情:
CGO_ENABLED=0 revel package -m prod -a project
docker 文件:
# you could do FROM scratch if you really need nothing
FROM alpine:3.10
# add dependencies
RUN apk --no-cache add ca-certificates tzdata
# add the untarred file produced by revel package
ADD project.tar.gz /opt
# whatever port
EXPOSE 8080
# I looked inside run.sh for this
CMD ["/opt/project", "-importPath", "project", "-srcPath", "/opt/src", "-runMode", "prod"]
关于docker - 通过 'revel build <testapp>' 的 run.sh 二进制文件未在 docker 容器内运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52221785/
我正在使用以下dockerfile: FROM ubuntu:14.04 MAINTAINER xxx xxx # SSH RUN apt-get update && apt-get install
我运行了docker-compose build celery,(经过数小时的尝试,我的连接不良)成功了。 app Dockerfile的前80%是相同的,但不会重复使用缓存。从我可以浏览的内容来看,
我可以使用以下命令成功创建 Docker 注册表 v2 服务:docker service create 然后我使用 docker Push 将一些图像推送到该服务。 当我通过 curl localh
我正在尝试使用 gitlab 构建 CI,我从 docker 的 docker 镜像开始,我的前端存储库没有任何问题,但现在使用相同的 gitlab-ci 配置文件,我有此守护程序错误。 这是构建的输
用例: 我们在 Jenkins 中有几个“发布作业”build 和 push 应用程序的 Docker 镜像到 docker registry,更新各种文件中的项目版本,最后将发布标签推送到相应的 G
当我尝试构建我的 docker 文件时,docker 返回以下错误: [+] Building 0.0s (1/2)
docker-in-docker 的作者在此博客中建议不要将此图像用于 CI 目的: jpetazzo/Using Docker-in-Docker for your CI or testing en
我创建了一个 Dockerfile 来在 Docker 中运行 Docker: FROM ubuntu:16.04 RUN apt-get update && \ apt-get in
我尝试为 Docker 镜像定位一个特定标签。我怎样才能在命令行上做到这一点?我想避免下载所有图像,然后删除不需要的图像。 在 Ubuntu 官方版本中,https://registry.hub.do
我正在尝试在docker中运行docker。唯一的目的是实验性的,我绝不尝试实现任何功能,我只想检查docker从另一个docker运行时的性能。 我通过Mac上的boot2docker启动docke
docker-compose.yml version: "3" services: daggr: image: "docker.pvt.com/test/daggr:stable"
我有一个非常具体的开发环境用例。在一些代码中,我启动了一个容器来抓取页面并检索在容器中运行的服务(Gitlab)的 token 。 现在,我希望 Dockerize 运行它的代码。具体来说,类似: o
之前已经问过这个问题,但我不确定当时是否可以使用docker-compose文件完成docker堆栈部署。 由于最新版本支持使用compose将服务部署到堆栈,因此,我无法理解dab文件的值。 我检查
我在一次采访中被问到这个问题,但无法回答。也没有找到任何相关信息。 最佳答案 正如 Docker 文档中所述,Docker 注册表是: [...] a hosted service containin
有没有一种方法可以将具有给定扩展名的所有文件复制到Docker中的主机?就像是 docker cp container_name:path/to/file/in/docker/*.png path/o
我的日志驱动程序设置为journald。使用日志记录驱动程序时,daemon.json文件中的日志级别配置会影响日志吗?使用docker logs 时仅会影响容器日志? 例如,docker和journ
我最近开始使用Docker + Celery。我还共享了full sample codes for this example on github,以下是其中的一些代码段,以帮助解释我的观点。 就上下文
运行docker build .命令后,尝试提交构建的镜像,但收到以下错误 Step 12 : CMD activator run ---> Using cache ---> efc82ff1ca
我们有docker-compose.yml,其中包含Kafka,zookeeper和schema registry的配置 当我们启动docker compose时,出现以下错误 docker-comp
我是Docker的新手。是否可以在Docker Hub外部建立Docker基本镜像存储库?假设将它们存储在您的云中,而不是拥有DH帐户?谢谢。 最佳答案 您可以根据需要托管自己的注册表。可以在Depl
我是一名优秀的程序员,十分优秀!