mysql8 添加触发器 作者: juoliii 时间: 2024-06-25 分类: 开发 评论 ```sql CREATE TRIGGER `UPDATECODE` before INSERT ON `apply_data` FOR EACH ROW begin SET new.code = concat(DATE_FORMAT(FROM_UNIXTIME(new.createTime/1000), '%Y%m%d'),LPAD((select count(1)+1 from apply_data where uid=new.uid),5,'0')); end ```
java sdk管理docker 作者: juoliii 时间: 2024-06-25 分类: 开发 评论 ```xml com.github.docker-java docker-java 3.3.6 com.github.docker-java docker-java-transport-httpclient5 3.3.6 ``` ```java DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() .withDockerHost("tcp://192.168.12.63:2375") .withDockerTlsVerify(false) // .withRegistryUrl("https://index.docker.io/v1/") // .withRegistryUsername("dockeruser") // .withRegistryPassword("ilovedocker") // .withRegistryEmail("dockeruser@github.com") .build(); DockerHttpClient httpClient= new ApacheDockerHttpClient .Builder() .dockerHost(config.getDockerHost()) .maxConnections(100) .connectionTimeout(Duration.ofSeconds(30)) .responseTimeout(Duration.ofSeconds(45)) .build(); DockerClient docker = DockerClientImpl.getInstance(config, httpClient); List containerList=docker.listContainersCmd().withShowAll(true).exec(); for (Container container : containerList) { System.out.println(container.getNames()[0]+" "+container.getState()); } ```
docker 配置远程访问 作者: juoliii 时间: 2024-06-24 分类: 开发 评论 ```shell find / -name docker.service 修改docker.service文件的ExecStart参数,增加-H tcp://0.0.0.0:2375 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd:// --containerd=/run/containerd/containerd.sock systemctl daemon-reload #重新加载服务docker的配置文件 systemctl restart docker #重启docker服务 curl http://localhost:2375/version ```
docker 部署minio 作者: juoliii 时间: 2024-06-24 分类: 开发 评论 ```shell docker run -p 9000:9000 -p 9001:9001 \ --name minio \ -d --restart=always \ -e "MINIO_ACCESS_KEY=minioadmin" \ -e "MINIO_SECRET_KEY=minioadmin" \ -v /data/minio:/data \ -v /usr/local/docker/minio/config:/root/.minio \ minio/minio server \ /data --console-address ":9001" -address ":9000" ```