挑战性的Docker问题:如何干净删除手动安装的docker - ce?

工作环境:Ubuntu 18.04.1

因为docker自动的源老出问题,所以就选择了手动安装,过程出奇的简单,具体步骤:
1. 下载 docker-18.03.1-ce.tgz
2. 解压 tar xzvf docker-18.03.1-ce.tgz
3. cp docker/* /usr/bin/
4. sudo docker run hello-world

所有网上可以查到的验证方法都可以通过,

sudo docker -v
Docker version 18.03.1-ce, build 9ee9f40

安装了一个lamp Container

# service docker status
● docker.service - docker static
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-12-13 16:25:07 CST; 33min ago
 Main PID: 14560 (dockerd)
    Tasks: 47 (limit: 4915)
   CGroup: /system.slice/docker.service
           ├─14560 /usr/bin/dockerd
           ├─14567 docker-containerd --config /var/run/docker/containerd/containerd.toml
           ├─14828 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3307 -container-ip 172.17.0.2 -container-port 3306
           ├─14840 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 81 -container-ip 172.17.0.2 -container-port 80
           ├─14847 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/886220dd45f02bf04d52f39d46af4dd5
           ├─14864 /bin/bash
           ├─14995 /usr/sbin/apache2 -k start
           ├─15000 /usr/sbin/apache2 -k start
           ├─15001 /usr/sbin/apache2 -k start
           ├─15007 /usr/sbin/apache2 -k start
           ├─15008 /usr/sbin/apache2 -k start
           ├─15009 /usr/sbin/apache2 -k start
           ├─15010 /usr/sbin/apache2 -k start
           ├─15011 /usr/sbin/apache2 -k start
           ├─15012 /usr/sbin/apache2 -k start
           └─15013 /usr/sbin/apache2 -k start

12月 13 16:25:07 Dell dockerd[14560]: time="2018-12-13T16:25:07.246084925+08:00" level=warning msg="Your kernel does not support cgroup rt runtime"

docker ps -a; docker start lamp; docker stop lamp; 等命令都可以正常执行。

但是这个安装无法正常卸载

root@Dell:/home/work# apt-get remove docker docker-engine docker-ce docker.io
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
软件包 docker-engine 未安装,所以不会被卸载
软件包 docker-ce 未安装,所以不会被卸载
软件包 docker 未安装,所以不会被卸载
软件包 docker.io 未安装,所以不会被卸载
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 211 个软件包未被升级。

不知在此是否可以找到答案?

其他相关信息:

$ sudo find / -iname docker
/usr/bin/docker
/run/docker
/var/lib/docker
/etc/docker
/sys/fs/cgroup/pids/docker
/sys/fs/cgroup/cpuset/docker
/sys/fs/cgroup/memory/docker
/sys/fs/cgroup/freezer/docker
/sys/fs/cgroup/perf_event/docker
/sys/fs/cgroup/blkio/docker
/sys/fs/cgroup/hugetlb/docker
/sys/fs/cgroup/cpu,cpuacct/docker
/sys/fs/cgroup/net_cls,net_prio/docker
/sys/fs/cgroup/devices/docker
/sys/fs/cgroup/systemd/docker


$ sudo find / -iname docker.service
/etc/systemd/system/multi-user.target.wants/docker.service
/sys/fs/cgroup/pids/system.slice/docker.service
/sys/fs/cgroup/devices/system.slice/docker.service
/sys/fs/cgroup/systemd/system.slice/docker.service
/sys/fs/cgroup/unified/system.slice/docker.service
/lib/systemd/system/docker.service
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
docker-php-ext-install: command not found

centos7 系统 的docker容器里面安装php扩展遇到了个纠结好几天的问题, ``` [root@localhost]#docker exec -it php72 bash root@9adf6d7117e0:/# docker-php-ext-install pdo pdo_mysql bash: docker-php-ext-install: command not found ``` bash: docker-php-ext-install: command not found这个问题,百度查了 都没有人遇到过这个问题,无奈发帖麻烦一下csdn的大神们帮忙一下了 1、系统centos7、centos6.8 安装的docker 阿里镜像源或者其他都尝试过了,都没有docker-php-ext-install 2、我有在自己公司的imac电脑装过docker是有docker-php-ext-install的,难道只有个别php镜像有包含docker-php-ext-install 这个东西吗? 那我们pull镜像之前 如何得知他是有包含docker-php-ext-install的 这中间是不是有啥规律或者潜规则

docker konradkleine/docker-registry-frontend:v2 运行之后点击repository报错

### docker konradkleine/docker-registry-frontend:v2 运行之后访问报错GET http://localhost:8082/v2/_catalog?n=&last= 503 (Service Unavailable) 启动容器配置本地镜像ip配置未生效, docekr-compose.yml 内容 ```yml version: '3.1' services: frontend: image: konradkleine/docker-registry-frontend:v2 restart: always container_name: registry-frontend ports: - 8082:80 volumes: - ./certs/frontend.crt:/etc/apache2/server.crt:ro - ./certs/frontend.key:/etc/apache2/server.key:ro environment: - ENV_DOCKER_REGISTRY_HOST=192.169.0.109 - ENV_DOCKER_REGISTRY_PORT=5000 ```

容器中挂载docker:/usr/bin/docker: 2: .: Can't open····

按照如下方式生成jenkins容器,并挂载docker: ``` docker run -d -p 8080:8080 --name jenkins -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock csphere/jenkins:1.609 ``` 容器正常启动,但是在容器中无法使用docker指令: ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511526587_994728.png) 一开始以为是文件的权限问题,但是已经修改文件的权限仍无法解除bug

docker-maven-plugin build 出现的一些问题,欢迎各位大佬前来解决

1. com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project springboot-nacos-register: Exception caught: Request error: POST http://192.168.120.134:2375/build?t=nacos: 500: HTTP 500 Internal Server Error -> [Help 1] 这个问题我百度了下往上说的都是repository name 不符合要求,但是我改成nacos去build 还是不行 2. 使用intellij idea docker 插件的时候 add * app.jar 提示 add 后面没有内容 这个错误

Docker:E:无法找到包mysql-client --no-install-recommended

<div class="post-text" itemprop="text"> <p>I'm following this tutorial: <a href="https://medium.com/@phillipmarkpadilla/laravel-5-6-in-docker-with-php-7-2-nginx-1-10-and-mysql-5-7-cdb6c054379c" rel="nofollow noreferrer">Laravel 5.6 in Docker with PHP 7.2, NGINX 1.10 and MySQL 5.7</a></p> <p>Which is basically an update of this: <a href="https://medium.com/@shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c" rel="nofollow noreferrer">Laravel + Docker Part 1 — setup for Development</a></p> <p>But when I ran </p> <pre><code>docker-compose up </code></pre> <p>I got this error</p> <pre><code>E: Unable to locate package mysql-client —-no-install-recommends ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql' returned a non-zero code: 100 </code></pre> <p>A full output </p> <pre><code>Creating network "pulzu_default" with the default driver Building app Step 1/2 : FROM php:7.2.2-fpm ---&gt; 60245f64ed12 Step 2/2 : RUN apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql ---&gt; Running in cefd70564b31 Get:1 http://security.debian.org stretch/updates InRelease [94.3 kB] Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB] Get:5 http://security.debian.org stretch/updates/main amd64 Packages [468 kB] Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB] Get:6 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B] Get:7 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB] Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9530 kB] Fetched 10.3 MB in 2s (4142 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package mysql-client —-no-install-recommends ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql' returned a non-zero code: 100 </code></pre> <p>Does anyone have any idea how to fix it?</p> </div>

在docker-compose up后,无法执行容器中的命令,找不到容器内组件的环境变量

docker-compose.yml文件内容如下 cassandra: image: cassandra:3.7 ports: - "7000:7000" - "7001:7001" - "7199:7199" - "9042:9042" - "9160:9160" zookeeper: image: wurstmeister/zookeeper ports: - "2181:2181" kafka: image: wurstmeister/kafka ports: - "9092:9092" links: - zookeeper:zk environment: KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 volumes: - /var/run/docker.sock:/var/run/docker.sock 在运行docker-compose up,三个容器启动后,老同事的电脑可以直接执行kafka,cassandra等组件的命令如kafka-topics.sh, 在我的电脑上却不行,效果就好比这三个组件的环境变量没有export到本身系统中,请问如何解决? 谢谢!

PHP Docker映像安装事件扩展失败

<div class="post-text" itemprop="text"> <p>I'm trying to install the <code>event</code> extension in <strong>PHP Docker</strong> using <code>pecl install event-2.5.3</code>, however, it fails with the error:</p> <blockquote> <p><strong>Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20160303/event.so: php_sockets_le_socket: symbol not found in Unknown on line 0</strong>. </p> </blockquote> <p>My Dockerfile:</p> <pre><code>FROM php:7.1.30-cli-alpine3.9 RUN apk --update add \ autoconf \ build-base \ linux-headers \ libevent-dev \ openldap-dev \ imagemagick-dev &amp;&amp; \ docker-php-ext-install pdo_mysql opcache sockets &amp;&amp; \ docker-php-ext-enable sockets &amp;&amp; \ pecl install event-2.5.3 &amp;&amp; \ docker-php-ext-enable event &amp;&amp; \ docker-php-ext-enable opcache \ &amp;&amp; rm -rf /var/cache/apk/* </code></pre> <p>This problem has puzzled me for a long time. Any suggestions?</p> </div>

如何从docker-compose.yml运行php文件

<div class="post-text" itemprop="text"> <p>I'm working on a docker project and I want to run a php file which will configure the database for the project.</p> <p>My Docker file : </p> <pre><code>FROM php:7.2-apache LABEL maintainer="admin@ksoftlabs.com" COPY site/ /var/www/html RUN chmod -R 777 /var/www/html RUN docker-php-ext-install mysqli COPY 000-default.conf /etc/apache2/sites- available/000-default.conf EXPOSE 80 CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] </code></pre> <p>My docker-compose.yml</p> <pre><code>version: '3.1' services: db: image: mysql command: --default-authentication-plugin=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: group_db server: image : apache ports: - "80:80" </code></pre> <p>I want to run the install.php which will be in /var/www/html/ directory. How can I do that?</p> <p><strong>Edit : I want to run this file automatically after the container is up</strong></p> </div>

Docker-entrypoint.sh导致使用golang的ARM映像“未找到”

<div class="post-text" itemprop="text"> <p>My problem is that I get an error when running my container on an ARM arch system(RaspberryPI with Raspbian). Image was built on that same Raspberry. </p> <p>This is my <code>dockerfile</code>:</p> <pre><code>FROM arm32v7/golang COPY qemu-arm-static /usr/bin ENV STATUSOK_VERSION 0.1.1 RUN apt-get update \ &amp;&amp; apt-get install -y unzip \ &amp;&amp; wget https://github.com/sanathp/statusok/releases/download/$STATUSOK_VERSION/statusok_linux.zip \ &amp;&amp; unzip statusok_linux.zip \ &amp;&amp; mv ./statusok_linux/statusok /go/bin/StatusOk \ &amp;&amp; rm -rf ./statusok_linux* \ &amp;&amp; apt-get remove -y unzip git \ &amp;&amp; apt-get autoremove -y \ &amp;&amp; apt-get clean \ &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* VOLUME /config COPY ./docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT /docker-entrypoint.sh </code></pre> <p>I'm able to succesfully build this on a RaspberryPI running Raspbian:</p> <pre><code>root@raspberrypi:~/armstatusok# docker build . -t armstatusok Sending build context to Docker daemon 6.656kB Step 1/7 : FROM arm32v7/golang ---&gt; 8bbfdfd01a06 Step 2/7 : COPY qemu-arm-static /usr/bin ---&gt; Using cache ---&gt; 2572fd1e03a0 Step 3/7 : ENV STATUSOK_VERSION 0.1.1 ---&gt; Using cache ---&gt; 25d39a4c6eb5 Step 4/7 : RUN apt-get update &amp;&amp; apt-get install -y unzip &amp;&amp; wget https://github.com/sanathp/statusok/releases/download/$STATUSOK_VERSION/statusok_linux.zip &amp;&amp; unzip statusok_linux.zip &amp;&amp; mv ./statusok_linux/statusok /go/bin/StatusOk &amp;&amp; rm -rf ./statusok_linux* &amp;&amp; apt-get remove -y unzip git &amp;&amp; apt-get autoremove -y &amp;&amp; apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ---&gt; Using cache ---&gt; bfb1cfa9a985 Step 5/7 : VOLUME /config ---&gt; Using cache ---&gt; 3bfbce28329b Step 6/7 : COPY ./docker-entrypoint.sh /docker-entrypoint.sh ---&gt; Using cache ---&gt; a1795ca4f40c Step 7/7 : ENTRYPOINT /docker-entrypoint.sh ---&gt; Using cache ---&gt; d0ce74911ba3 Successfully built d0ce74911ba3 Successfully tagged armstatusok:latest </code></pre> <p>Next step is to run it, and where I get into trouble:</p> <pre><code>root@raspberrypi:~/armstatusok# docker run --name=armstatusok -v $PWD:/config armstatusok /docker-entrypoint.sh: 1: /docker-entrypoint.sh: /go/bin/StatusOk: not found </code></pre> <p>I went into the container commenting line one of the <code>docker-entrypoint.sh</code> and checked if <code>/go/bin/StatusOk</code> was actually there, and it was.</p> <p>My <code>docker-entrypoint.sh</code>:</p> <pre><code>root@raspberrypi:~/armstatusok# cat docker-entrypoint.sh /go/bin/StatusOk --config /config/config.json </code></pre> <p>Now my question is, does anybody have a clue where to start? I also tested this dockerfile on x86 arch, and there it worked. I only changed the FROM line to the x86 flavour and removed the <code>COPY qemu-arm-static /usr/bin</code> since that line is there to make it work on ARM arch, according to documentation.</p> </div>

无法在PHP5.6-apache容器中安装memcached包

<div class="post-text" itemprop="text"> <p>I'm trying to get mamcache working. Using example from <a href="https://hub.docker.com/_/php/" rel="nofollow">https://hub.docker.com/_/php/</a> (PECL extensions).</p> <p>My dockerfile simple does next:</p> <pre><code> FROM php:5.6-apache RUN apt-get update &amp;&amp; apt-get install -y libmemcached-dev \ &amp;&amp; pecl install memcached \ &amp;&amp; docker-php-ext-enable memcached </code></pre> <p>But finally I got next:</p> <pre><code>checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=&lt;DIR&gt; to specify the prefix where ZLIB headers and library are located ERROR: `/tmp/pear/temp/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir=no' failed error: /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcached does not exist usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...] ie: /usr/local/bin/docker-php-ext-enable gd mysqli /usr/local/bin/docker-php-ext-enable pdo pdo_mysql /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc Possible values for module-name: opcache.so </code></pre> <p>What do I do wrong ?</p> </div>

如何使用docker-compose连接到PostgreSQL?

<div class="post-text" itemprop="text"> <p>Want to use <code>docker-compose</code> to run api application and postgresql database together. </p> <p><code>docker-compose</code> file:</p> <pre><code>version: '3' volumes: database_data: driver: local services: db: image: postgres:latest volumes: - database_data:/var/lib/postgresql/data api: build: ./api expose: - 8080 ports: - 8080:8080 volumes: - ./api:/usr/src/app/ links: - db environment: - PGHOST=db - PGDATABASE=postgres - PGUSER=postgres </code></pre> <p>Api <code>main.go</code> file:</p> <pre><code>func main() { db, err = gorm.Open("postgres", "host=db port=5432 user=postgres dbname=postgres") // ... } </code></pre> <p>When run the services, got message from log:</p> <pre><code>api_1 | [GIN] 2018/06/22 - 07:31:10 | 404 | 1.4404ms | 172.20.0.1 | GET /posts api_1 | api_1 | (sql: database is closed) api_1 | [2018-06-22 07:31:10] api_1 | api_1 | (sql: database is closed) api_1 | [2018-06-22 07:31:10] api_1 | [GIN] 2018/06/22 - 07:32:14 | 403 | 15.6µs | 172.20.0.1 | GET /posts db_1 | 2018-06-22 07:34:27.296 UTC [81] FATAL: role "root" does not exist db_1 | 2018-06-22 07:34:36.897 UTC [90] FATAL: role "root" does not exist </code></pre> <p>Does this way not good? <code>host=db</code> in the connection string? Since <code>db</code> is the docker compose service name.</p> <hr> <h1>Add</h1> <p>It can work:</p> <p><a href="https://docs.docker.com/samples/library/postgres/#-or-via-psql" rel="nofollow noreferrer">https://docs.docker.com/samples/library/postgres/#-or-via-psql</a></p> </div>

PHP MARIADB PHPMYADMIN使用docker-compose的问题

<div class="post-text" itemprop="text"> <p>I've been this last two weeks searching how to link my phpmyadmin and my database, to create a PHP development workspace, through docker-compose but I am not able to connect to the database through the phpmyadmin port. </p> <pre><code> version: '3' services: servicio_php: image: php:7.3-rc-apache volumes: - ./web/:/var/www/html expose: - "80" ports: - "80:80" links: - db db: image: mariadb:latest restart: always volumes: - ./Volumenes/mysql:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root123 MYSQL_USER: user MYSQL_PASSWORD: user123 MYSQL_DATABASE: bbdd1 expose: - "3306" ports: - "3306:3306" phpmyadmin: image: phpmyadmin/phpmyadmin:latest container_name: phpmyadmin environment: PMA_ARBITRARY: 1 MYSQL_ROOT_PASSWORD: root123 MYSQL_USERNAME: user PMA_HOST: db MYSQL_PASSWORD: user123 restart: always ports: - "8080:80" volumes: - ./sessions:/sessions/ depends_on: - db links: - db </code></pre> <p>I am using windows 10 version of dockers 18.06.1-ce and also when i run docker-compose up i see there are some probles with Innodb but ive read is not a problem. </p> <p>I am not able to see whats wrong and probably I am not the only one with this problem.</p> </div>

Docker撰写:Nginx和PHP-FPM无法正常工作

<div class="post-text" itemprop="text"> <p>I'm testing docker compose with Nginx and php-fpm, but this fail. My docker-compose.yml:</p> <pre><code>version: '2' services: nginx: container_name: nginx build: context: ./dockerfiles/nginx/ dockerfile: Dockerfile volumes: - ./project/:/usr/share/nginx/html/ ports: - "8000:80" links: - php php: container_name: php-fpm image: php:7-fpm volumes: - ./project/:/var/www/html/ ports: - "9000:9000" </code></pre> <p>This is my dockerfile Nginx:</p> <pre><code>FROM nginx:latest COPY config/default.conf /etc/nginx/conf.d/ </code></pre> <p>And dafault.conf file:</p> <pre><code>server { listen 80; server_name localhost; root /usr/share/nginx/html; location / { try_files $uri /index.php$is_args$args; } location ~ ^/.+\.php(/|$) { fastcgi_pass php:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } </code></pre> <p>when I try localhost: 8000 returns the following message:</p> <p>"File not found."</p> <p>but, the index.php is in the project/ path.</p> <p>that I am wrong?</p> </div>

Hyperledger Fabric 在 chaincode-docker-devmode 中為何加入CouchDB容器,會導致Cli容器無法啟動?

因为目前还在初学阶段,所以选择fabric-simple 中的开发者模式来测试chaincode,但当我在docker-compose-simple.yaml 中加入 CouchDB容器,如下: ``` version: '2' services: orderer: container_name: orderer image: hyperledger/fabric-orderer environment: - FABRIC_LOGGING_SPEC=debug - ORDERER_GENERAL_LISTENADDRESS=orderer - ORDERER_GENERAL_GENESISMETHOD=file - ORDERER_GENERAL_GENESISFILE=orderer.block - ORDERER_GENERAL_LOCALMSPID=DEFAULT - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp - GRPC_TRACE=all=true, - GRPC_VERBOSITY=debug working_dir: /opt/gopath/src/github.com/hyperledger/fabric command: orderer volumes: - ./msp:/etc/hyperledger/msp - ./orderer.block:/etc/hyperledger/fabric/orderer.block ports: - 7050:7050 couchdb: container_name: couchdb image: hyperledger/fabric-couchdb environment: - COUCHDB_USER= - COUCHDB_PASSWORD= ports: - 5984:5984 peer: container_name: peer image: hyperledger/fabric-peer dns_search: . environment: - CORE_PEER_ID=peer - CORE_PEER_ADDRESS=peer:7051 - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer:7051 - CORE_PEER_LOCALMSPID=DEFAULT - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - FABRIC_LOGGING_SPEC=DEBUG - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp - CORE_LEDGER_STATE_STATEDATABASE=CouchDB - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984 - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME= - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD= volumes: - /var/run/:/host/var/run/ - ./msp:/etc/hyperledger/msp working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer command: peer node start --peer-chaincodedev=true ports: - 7051:7051 - 7053:7053 depends_on: - orderer - couchdb cli: container_name: cli image: hyperledger/fabric-tools tty: true environment: - GOPATH=/opt/gopath - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - FABRIC_LOGGING_SPEC=DEBUG - CORE_PEER_ID=cli - CORE_PEER_ADDRESS=peer:7051 - CORE_PEER_LOCALMSPID=DEFAULT - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp working_dir: /opt/gopath/src/chaincodedev command: /bin/bash -c './script.sh ; sleep 20' volumes: - /var/run/:/host/var/run/ - ./msp:/etc/hyperledger/msp - ./../chaincode:/opt/gopath/src/chaincodedev/chaincode - ./:/opt/gopath/src/chaincodedev/ depends_on: - orderer - peer chaincode: container_name: chaincode image: hyperledger/fabric-ccenv tty: true environment: - GOPATH=/opt/gopath - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - FABRIC_LOGGING_SPEC=DEBUG - CORE_PEER_ID=example02 - CORE_PEER_ADDRESS=peer:7051 - CORE_PEER_LOCALMSPID=DEFAULT - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp working_dir: /opt/gopath/src/chaincode command: /bin/bash -c 'sleep 6000000' volumes: - /var/run/:/host/var/run/ - ./msp:/etc/hyperledger/msp - ./../chaincode:/opt/gopath/src/chaincode depends_on: - orderer - peer ``` 当我使用以下指令启动容器, ``` docker-compose -f docker-compose-simple.yaml up ``` 唯有Cli 容器是无法启动的状态,并在Logs中返回以下错误讯息 ``` Error: error getting endorser client for channel: endorser client failed to connect to peer:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 172.29.0.4:7051: connect: connection refused" ``` 有查询到同样错误讯息的人是在docker 启动设定档加入sleep指令,加长等待时间以确定CouchDB启动 ``` command: /bin/bash -c 'sleep 6000000' ``` 但我即使加入了,还是会报相同的错误

尝试在运行docker-toolbox的Windows上使用docker-compose在docker容器内运行webpack-dev-server时出现“服务器的空响应”

<div class="post-text" itemprop="text"> <p>I am having problems accessing a react container run with docker-compose inside docker-machine. I can curl the webpage inside the container, but I cannot access it inside docker-machine (or on the host's browser for that matter). The backend Golang container can be accessed from docker-machine and from the host's browser (as seen in the snippets, it returns a <em>404 not found</em>).</p> <p>In the docker-compose logs everything seems to be running smoothly, webpack-dev-server runs as expected, I just can't access it from outside the container.</p> <p>I am using docker toolbox for windows.</p> <p>Best to additionally describe the problem with some snippets.</p> <p><strong>Docker-compose file:</strong></p> <pre><code>version: '2' services: postgres: image: postgres environment: - POSTGRES_PASSWORD=postgres server: build: ./server command: gin volumes: - ./server:/go/src/app ports: - "8080:3000" environment: - POSTGRES_PASSWORD=postgres client: build: ./client command: npm start volumes: - ./client:/usr/src/app # mount node_modules as a workaround for it disappearing # after adding /client as a mounted folder - /usr/src/app/node_modules ports: - "9000:3000" </code></pre> <p><strong>Dockerfile for the node container:</strong></p> <pre><code>FROM node:6.5.0-slim RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ ENV NODE_ENV development RUN npm install </code></pre> <p><strong>Output of the following commands inside docker-machine (default):</strong></p> <blockquote> <p>docker@default:~$ sudo iptables -t nat -L -n</p> </blockquote> <pre><code>Chain PREROUTING (policy ACCEPT) target prot opt source destination DOCKER all -- 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination DOCKER all -- 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 172.17.0.0/16 0.0.0.0/0 MASQUERADE all -- 172.19.0.0/16 0.0.0.0/0 MASQUERADE all -- 172.18.0.0/16 0.0.0.0/0 MASQUERADE tcp -- 172.19.0.2 172.19.0.2 tcp dpt:3000 MASQUERADE tcp -- 172.19.0.3 172.19.0.3 tcp dpt:3000 Chain DOCKER (2 references) target prot opt source destination RETURN all -- 0.0.0.0/0 0.0.0.0/0 RETURN all -- 0.0.0.0/0 0.0.0.0/0 RETURN all -- 0.0.0.0/0 0.0.0.0/0 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 to:172.19.0.2:3000 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:9000 to:172.19.0.3:3000 </code></pre> <p><em>Here comes the main problem:</em></p> <blockquote> <p>docker@default:~$ curl 0.0.0.0:9000</p> </blockquote> <pre><code>curl: (52) Empty reply from server </code></pre> <blockquote> <p>docker@default:~$ curl 0.0.0.0:8080</p> </blockquote> <pre><code>404 page not found </code></pre> <blockquote> <p>docker@default:~$ docker ps</p> </blockquote> <pre><code>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f93fd1833de2 goreacttodo_client "npm start" 32 minutes ago Up 5 minutes 0.0.0.0:9000-&gt; 3000/tcp goreacttodo_client_1 ff1fa9c33b05 postgres "/docker-entrypoint.s" 3 days ago Up 5 minutes 5432/tcp goreacttodo_postgres_1 e4581f8e368b goreacttodo_server "gin" 3 days ago Up 5 minutes 0.0.0.0:8080-&gt; 3000/tcp goreacttodo_server_1 </code></pre> <p>Output of the following commands inside the node container:</p> <blockquote> <p>root@f93fd1833de2:/usr/src/app# curl localhost:3000</p> </blockquote> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body lang="en"&gt; &lt;div id="react-app"&gt;&lt;/div&gt; &lt;script src="/bundle.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p>Any help would be greatly appreaciated.</p> </div>

LAMP-Stack with Docker:如何修改httpd.conf以访问PHP-FPM?

<div class="post-text" itemprop="text"> <p>I have some trouble to get access from my apache container to Php-fpm. My docker-compose file is ready and works fine. But I don't know how to modify the httpd.conf in order to establish communication between both containers (Apache and Php-fpm). I have looked for some useful tutorials on the internet, but everyone uses Nginx instead of Apache2. There is also a preconfigured Docker image consisting of a Apache webserver and Php-fpm on Docker Hub, but I prefer two seperated images, because of replaceability.</p> <p>Here is my docker-compose file:</p> <pre><code>version: "3.5" services: webserver: build: apache/ ports: - "8080:80" - "443:443" volumes: - ~/Docker-Images/example/apache/html:/usr/local/apache2/htdocs links: - php-fpm php-fpm: build: php-fpm/ ports: - "9000:9000" links: - database database: build: mysql/ ports: - "3306:3306" volumes: - ~/Docker-Images/example/mysql/init-scripts:/init-scripts volumes: webserver: database: </code></pre> <p>If you need my httpd.conf, let me know! I haven't added it, because it is a very long file with only default values.</p> </div>

Docker的linux容器中安装软件提示无法定位软件包

在虚拟机中安装Docker,并下载Ubuntu镜像。 拉取镜像,并启动docker后,在Ubuntu中安装vim,安装netstat都显示无法定位软件包

Go应用程序失败并在使用docker-compose运行时退出,但可与docker run命令配合使用

<div class="post-text" itemprop="text"> <p>I am running all of these operations on a remove server that is a <strong>VM running Ubuntu 16.04.5 x64</strong>.</p> <p>My Go project's Dockerfile looks like:</p> <pre><code>FROM golang:latest ADD . $GOPATH/src/example.com/myapp WORKDIR $GOPATH/src/example.com/myapp RUN go build #EXPOSE 80 #ENTRYPOINT $GOPATH/src/example.com/myapp/myapp ENTRYPOINT ./myapp #CMD ["./myapp"] </code></pre> <p>When I run the docker container using <code>docker-compose up -d</code>, the Go application exits and I see this in the docker logs:</p> <blockquote> <p>myapp_1 | /bin/sh: 1: ./myapp: Exec format error docker_myapp_1 exited with code 2</p> </blockquote> <p>If I locate the image using <code>docker images</code> and run the image like:</p> <pre><code> docker run -it 75d4a95ef5ec </code></pre> <p>I can see that my golang applications runs just fine:</p> <blockquote> <p>viper environment is: development HTTP server listening on address: ":3005"</p> </blockquote> <p>When I googled for this error some people suggested compiling with some special flags but I am running this container on the same Ubuntu host so I am really confused why this isn't working using docker.</p> <p>My docker-compose.yml looks like:</p> <pre><code>version: "3" services: openresty: build: ./openresty ports: - "80:80" - "443:443" depends_on: - myapp env_file: - '.env' restart: always myapp: build: ../myapp volumes: - /home/deploy/apps/myapp:/go/src/example.com/myapp ports: - "3005:3005" depends_on: - db - redis - memcached env_file: - '.env' redis: image: redis:alpine ports: - "6379:6379" volumes: - "/home/deploy/v/redis:/data" restart: always memcached: image: memcached ports: - "11211:11211" restart: always db: image: postgres:9.4 volumes: - "/home/deploy/v/pgdata:/var/lib/postgresql/data" restart: always </code></pre> </div>

使用docker-compose还需要dockerfile来构建镜像吗?

docker-compose 有 build,使用docker-compose build 还需要dockerfile 组合 docker build 来构建镜像吗? 这是我的 docker-compose文件 镜像地址是正确的打了 version: '3.3' services: cloud-eureka-server: image: registry.cn-han*****s/cloud-eureka-server:v3.0 restart: always hostname: discovery networks: default: ports: - 8761:8761 networks: default: external: name: zh-net

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

立即提问
相关内容推荐